WordPress.org

Ready to get started?Download WordPress

Forums

Widgets with Effects (2 posts)

  1. obeattie
    Member
    Posted 8 years ago #

    Hey There,

    I'm trying to expand my theme (it is already compatible with widgets), that each widget is contained in a div with a unique ID. For example, widget 1:
    <div id="widget-1">

    Widget 2;

    <div id="widget-2">

    And so on. So, what I would ideally like to is assign a variable, like $widgetcount and add one to it just before each widget. Then after that to display the value of that variable in the div.

    I presume the code would look something like this:

    before all widgets..
    <?php $widgetcount = 0; ?>

    before each widget..<br />
    <?php $widgetcount +1; ?><div id="widget=<?php echo $widgetcount; ?>">

    and then after each..

    </div>

    Does anyone have any ideas on how I could do this?

    Many Thanks,
    Oli

  2. obeattie
    Member
    Posted 8 years ago #

    Nobody?

Topic Closed

This topic has been closed to new replies.

About this Topic