WordPress.org

Ready to get started?Download WordPress

Forums

Modifying class tags for div's on widgets with widget title (2 posts)

  1. bahamallama
    Member
    Posted 5 years ago #

    I'm trying to fine tune my theme for my site and I need to have the widget title show up as the class of a div. I would like each widget to be able to have it's own image associated with that div and I've tried a bunch of things with no luck. Here's my code from functions.php:
    '
    if ( function_exists('register_sidebar') ) {
    register_sidebar(array(
    'before_widget' => '<div class="box">

  2. ',
    'after_widget' => '
  3. </div>',
    'before_title' => '<h2>',
    'after_title' => '</h2><div class= " NEED TITLE HERE"></div>',
    ));
    }
    '

    I obviously need it where it says NEED TITLE HERE. I figure I could just access the variable title for each widget and be done with it but I couldn't get anything to work. I'm fairly new to php so forgive me if this is obvious and if this is in the wrong forum please feel free to move it.

    Thanks in advance!
    D

  • bahamallama
    Member
    Posted 5 years ago #

    Nobody has any idea how to use the variable for the title of the widget?

    Can anyone tell me where I can find the pages and archives code for the widgets?

    Thanks,
    D

  • Topic Closed

    This topic has been closed to new replies.

    About this Topic

    Tags