Widgetizing Your Blog Widgetizing seu blog
June 15th, 2007 · by David Bradley 15 de junho de 2007 por David Bradley
If you have already upgraded to Wordpress 2.2, then this post is not for you. Se você já tiver atualizado para Wordpress 2,2, então este post não é para você. 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. Mas, se você estiver languishing em uma instalação anterior e em funcionamento um tema que não suporta widgets, então você pode querer verificar para fora de como obter widgetized. But, first what are widgets? Mas, primeiro quais são os 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. Pois bem, eles são poucos trechos de código que se sentar em suas próprias casas dentro de sua barra lateral e pode ser reordenadas com um simples arrastar e soltar. So, your search box is at the bottom and your Feedburner count at the top but you want them the other way around? Portanto, sua caixa de pesquisa está na parte inferior e sua contagem FeedBurner no topo, mas você deseja que eles o contrário? 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. É um lote de recortar e colar com o Editor Tema padrão na barra lateral, mas se o seu blog é widgetized tudo que você deve fazer é arrastar a pesquisa widget para o topo da pilha e bloquear o FeedBurner para o fundo. And save the new settings. E salvar as novas configurações.
The Automattic site has the full skinny on O site tem o pleno Automattic magro em widgetizing your site widgetizing seu site and provides you with the necessary downloads, so I am not going to repeat their wise words here. e fornece-lhe a necessária downloads, por isso não vou repetir aqui as suas palavras sábias. 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. Porém, um aspecto da widgetizing a Sciencebase site no início deste ano, antes do lançamento da versão 2,2, foi que eu simplesmente não podia erradicar órfãs um ponto que foi exibido na parte superior da barra lateral com a entrada não foi o que está associado. 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). I messed ao redor com o li e ul tags nas próprias widgets, jogou com o css no widgets.php (adicionando a lista de estilo-type: none; tag para todos os diversos e de tentar apagar o pequeno dot). 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. Na verdade, eu gostava cresceu bastante do critter pouco no final, mas sabia que a maioria dos visitantes prefere não ver a bala, era demasiado distracção.
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. Finalmente, depois de pesquisar a web e ler o manual de uma dúzia de vezes ou mais, fui Automattic de volta para o sítio, onde ele finalmente dawned em mim um hack que eles mencionado no que diz respeito à não-padrão formating barras laterais pronto para ser widgetized possam efectivamente trabalhar para eu também.
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. Para fazer widgets trabalhar em versões de pré-2,2 Wordpress que você tem que ter um arquivo chamado em seu functions.php tema da pasta. 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: Esse arquivo, mas nada detém uma tag condicional para tornar a barra lateral widgetized conforme o caso, mas você pode adicionar um argumento extra ou dois para tornar o widget plugin ignorar alguns dos formating na sua inerente CSS:
<?php <? PHP
if ( function_exists(’register_sidebar’) ) if (function_exists ( 'register_sidebar'))
register_sidebar(array( register_sidebar (array (
‘before_widget’ => ”, // Removes the list tag 'Before_widget "=>", / / Remove a lista tag
‘after_widget’ => ”, // Removes removes the end list entry tag 'After_widget "=>", / / Remove remove a lista final entrada tag
‘before_title’ => ”, // Removes the head tag 'Before_title "=>", / / Remove a cabeça tag
‘after_title’ => ”, // Removes the end head tag 'After_title "=>", / / Remove o final cabeça tag
));
?>
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. Uma vez eu acrescentou este código, que fixa o ângulo entre parêntesis a ser a real html recintos, e reabertos Sciencebase o site até que surgiram, sans bala. I will miss the little critter though. Vou perder o pouco critter embora.






















2 responses so far ↓ 2 respostas até agora ↓
Eliena // Eliena / / Jun 17, 2007 at 2:35 pm 17 de Junho de 2007 em 2:35 pm
can i implement this code on my blog page ? i pode executar esse código no meu blog página?
David Bradley David Bradley // / / Jun 17, 2007 at 7:02 pm 17 de Junho de 2007 em 7:02 pm
Sorry Eliena, but I don’t understand why you would want to do that in the first place. Eliena Desculpe, mas eu não entendo por que você iria querer fazer isso, em primeiro lugar. 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 é o seu próprio sistema, provavelmente você não tiver acima blog pastas qualquer maneira, de forma que você seria de aplicação, independentemente do facto de se cortar o Wordpress?
db DB
Leave a Comment Deixe um comentário