Widgets with Effects (2 posts)

  1. obeattie
    Posted 9 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..


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

    Many Thanks,

  2. obeattie
    Posted 9 years ago #


Topic Closed

This topic has been closed to new replies.

About this Topic