Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

I have mainly seen sites using widgets on sidebars or inside multi-column layout. However, I was wondering what if we could use widgets in every blocks like header, main content block, footer etc. Is that a good or a bad idea?

share|improve this question
    
Converting this to a wiki since there isn't a single "right" answer but more a discussion of best practices. –  EAMann Feb 6 '12 at 16:38

3 Answers 3

No technical reason why not to do that , as long as you keep the semantic and code all right (meaning a Header HEAD tag with proper content and footer to accommodate script and functions - both not necessarily visual) I actually think it is a good idea for a theme ...Can give a HUGH flexibility for users , although it would make you need to write widgets to contain ALL the functions of WP , like Content , title, comments etc with a lot of options. At that point, it is becoming almost a FORK of wordpress :-) - But again, +1 for the idea !

share|improve this answer
    
Thanks !!! @krembo99 for your nice explanation!! –  Rahul dagli Feb 4 '12 at 12:53

IMHO, using widgets on all areas is a bad idea. The widgets should be used for their purpose, meaning we should use widgets where there can add/remove content.

I see some people widgetize the area for header, that's not cool, because in fact you don't use any widgets more in that area. That breaks the understanding of widgetized area, where we can have many widgets.

Of course that's not a fixed rule. It depends on the situation. For ex.: we have a front page with some boxes of text. While we (developers) want the client can change the text content of that boxes, using a text widget (thus a widgetized area) is good, though we use only one widget in that area.

So, a good practice is: - widgetize the area where we want users (clients) change the content easily - but don't widgetize the area where it's nearly fixed (HTML markup or content)

share|improve this answer

This can be difficult to work with from a dev point of view, so if your selling your theme or in the future having someone else work on it, it won't use the default structure and semantics of WordPress which I consider bad form. But there is no reason why it can't have both, meaning if widgets are not used, it falls back into a more normal structure. And also make sure it is well commented;)

share|improve this answer
    
what is the reason you would say that it can not use semantic form ? I can see no difference in the output providing that the widgets are correctly coded .. –  krembo99 Feb 5 '12 at 4:33
    
I meant semantic in terms of wordpress code itself not the html output, maybe I used the term wrong. –  Wyck Feb 5 '12 at 15:55
    
ok, I understand , but I can not see the problem also with semantic as referred to wordpress. would you care to explain ? –  krembo99 Feb 5 '12 at 16:02
    
Well for example I have seen custom theme widgets that replace the default loop, so when you look into the code there is no standard loop which can be a problem. But even further they are often custom functions that cannot be altered by standard hooks (filters and a actions), so that leaves you with trying to understand some coders function instead of a wordpress one. –  Wyck Feb 5 '12 at 21:44
    
I understand what you are trying to say, and I also said in my answer that this is a LOT of work, but I still do not see a reason why , with the right planning, one can not achieve the right structure (including the loop) with widgets.. It is just a very long and painful coding, but the result can be very very interesting in terms of flexibility to the end user (especially beginners) –  krembo99 Feb 6 '12 at 2:17

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.