Widgetizing Your Blog Widgetizing блога
June 15th, 2007 · by David Bradley 15 июня 2007 года Дэвид Брэдли
If you have already upgraded to Wordpress 2.2, then this post is not for you. Если вы уже повышен до 2,2 Wordpress, то эта должность не для вас. But, if you are languishing on an earlier installation and running a theme that does not support widgets, then you may like to check out how to get widgetized. Но, если вы томятся в начале установки и запуска тему, которая не поддерживает виджеты, то вы можете проверить, как добраться widgetized. But, first what are widgets? Но, во-первых какие виджеты? Well, they’re little snippets of code that sit in their own boxes within your sidebar and can be reordered with a simple drag and drop. Ну, они мало фрагменты кода, которые сидят в своих собственных ящиков в боковой панели и могут быть изменены с простого перетаскивания. So, your search box is at the bottom and your Feedburner count at the top but you want them the other way around? Итак, окно поиска находится в нижней части, а Feedburner рассчитывать на рейтинг, но вы хотите, наоборот? It’sa lot of cutting and pasting with the standard sidebar in Theme Editor, but if your blog is widgetized all you do is drag the search widget to the top of the stack and the Feedburner block to the bottom. Это много резка и вставки в стандартной панели тема в редакцию, но, если блог widgetized все, что вам делать это перетащить поиск виджет к вершине стека и Feedburner блок снизу. And save the new settings. И сохранить новые настройки.
The Automattic site has the full skinny on Automattic сайт имеет полное стройная о widgetizing your site widgetizing Вашем сайте and provides you with the necessary downloads, so I am not going to repeat their wise words here. и предоставляет вам необходимо скачать, поэтому я не буду повторять их здесь мудрые слова. But, one aspect of widgetizing the Sciencebase site earlier this year, prior to the release of version 2.2, was that I simply could not eradicate an orphaned bullet point that was appearing at the top of the sidebar with no entry to which is was associated. Но один аспект widgetizing Sciencebase сайте в начале этого года, до выпуска версии 2,2 заключалось в том, что я просто не мог искоренить сиротами пулей, что отображалось в верхней части боковой панели без каких-либо вход, к которому был связан. I messed around with the li and ul tags in the widgets themselves, played with the css in the widgets.php (adding the list-style-type: none; tag to all and sundry to try and delete the little dot). Я messed вокруг с Ли и уль-теги в себя виджеты, играл с css в widgets.php (добавляя список в стиле типа: нет; метки для всех и разные, чтобы попытаться удалить мало точками). Actually, I grew quite fond of the little critter in the end, but knew that most visitors would prefer not to see the bullet, it was far too distracting. Собственно, я вырос совершенно любил мало critter в конце, но знал, что большинство посетителей предпочитают не видеть пули, он был слишком отвлекают.
Finally, after searching the web and reading the manual a dozen times or more I went back to the Automattic site, where it finally dawned on me that a hack they mentioned in regard to formating non-standard sidebars ready to be widgetized might actually work for me too. Наконец, по окончании поиска по Интернету и чтения руководства десятка и более раз я вернулся к Automattic сайт, где она, наконец, dawned по мне, что взломать они упомянули в связи с formating нестандартных боковые готов к widgetized может фактически работы я тоже.
To make widgets work in versions of Wordpress pre-2.2 you have to have a file called functions.php in your theme’s folder. Чтобы сделать виджеты работают в версии Wordpress до-2,2 вы должны иметь файл functions.php в вашей теме папку. This file holds nothing but a conditional tag to render the widgetized sidebar as appropriate, but you can add an extra argument or two to make the widget plugin ignore some of the formating in its inbuilt CSS: Этот файл содержит ничего, кроме условных тегов оказывать widgetized боковой панели в зависимости от обстоятельств, но вы можете добавить дополнительный аргумент или два сделать виджет плагин игнорировать некоторые formating в ее inbuilt CSS:
<?php <? php
if ( function_exists(’register_sidebar’) ) если (function_exists ( 'register_sidebar'))
register_sidebar(array( register_sidebar (массив (
‘before_widget’ => ”, // Removes the list tag "Before_widget '=>", / / Удаляет список тегов
‘after_widget’ => ”, // Removes removes the end list entry tag "After_widget '=>", / / удаление удаляет конце списка вступления тег
‘before_title’ => ”, // Removes the head tag "Before_title '=>", / / Удаляет голову тег
‘after_title’ => ”, // Removes the end head tag "After_title '=>", / / Удаляет конце головы тег
));
?>
Once I’d added this code, fixing the angle brackets to be the actual html enclosures, and reloaded the Sciencebase site up it popped, sans bullet. После того как я добавил этот код, а также определение угла скобках будет фактическим html вольерах, а перезарядка Sciencebase сайт мер он popped, без пули. I will miss the little critter though. Мне будет не хватать, хотя мало critter.






















2 responses so far ↓ 2 ответов до сих пор ↓
Eliena // Eliena / / Jun 17, 2007 at 2:35 pm 17 июня 2007 года в 2:35 вечера
can i implement this code on my blog page ? Можно ли выполнить этот код на моей странице блога?
David Bradley Дэвид Брэдли // / / Jun 17, 2007 at 7:02 pm 17 июня 2007 года в 7:02 вечера
Sorry Eliena, but I don’t understand why you would want to do that in the first place. Eliena Извините, но я не понимаю, почему вы хотели бы сделать это в первую очередь. Blogspot is its own system, presumably you have not above blog folders anyway, so what would you be implementing, regardless of the fact the hack is for Wordpress? Blogspot имеет свою собственную систему, вероятно, у вас не выше блоге папок в любом случае, это то, что бы Вы реализации, независимо от того факта, взломать для Wordpress?
db дб
Leave a Comment Оставьте комментарий