Wordpress Themes - WP Forum at BFA
There will be no more development for Atahualpa (or any other theme), and no support. Also no new registrations. I turned off the donation system. I may turn the forum to read only if it gets abused for spam. Unfortunately I have no time for the forum or the themes. Thanks a lot to the people who helped in all these years, especially Larry and of course: Paul. Take care and stay healthy -- Flynn, Atahualpa developer, Sep 2021

Wordpress Themes - WP Forum at BFA » WordPress Themes » Atahualpa 3 Wordpress theme » Sidebars & Widgets »

[SOLVED] Add Sequential ID To Each Widget


 
Prev Previous Post   Next Post Next
  #1  
Old Jul 27, 2012, 09:32 AM
bswb97
 
158 posts · Aug 2010
[SOLVED] Add Sequential ID To Each Widget

I want to add an individual sequentially numbered ID to each widget. In the template code, I have no problem adding the div with ID. However, I don't know how WP calls out a sequential variable. I can't seem to find any clear documentation on this.

For example, if you have three widgets in the sidebar, the source HTML will show:

<div id="widgetcontainer1">...content...</div>
<div id="widgetcontainer2">...content...</div>
<div id="widgetcontainer3">...content...</div>

I have no problem assigning a generic <div id="widgetcontainer"> in the template but I'm not sure how to add the automatic sequential numbering. I have some widgets that call out some messy class assignments, so this will help me simplify for a particular project.
 

Bookmarks

Tags
widget div




All times are GMT -6. The time now is 06:48 PM.


Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.