Title: Get Widget Title
Last modified: August 19, 2016

---

# Get Widget Title

 *  [atirez](https://wordpress.org/support/users/atirez/)
 * (@atirez)
 * [16 years, 6 months ago](https://wordpress.org/support/topic/get-widget-title/)
 * Hi all, I am trying to register my own sidebar to modify the format of the outputted
   html, like so:
 *     ```
       <?php
       if ( function_exists('register_sidebar') )
           register_sidebar(array(
           'before_widget' => '<div id="%1$s" class="widget entry %2$s">',
           'after_widget'  => '</div>',
           'before_title'  => '<h2 class="widgettitle">%1$',
           'after_title'   => '</h2>' ));
       ?>
       ```
   
 * That all works great. However, what I really wanted to do was to obtain the Title
   text associated with the current widget. That is for example “Archives” or whatever
   the user has changed that to.
 * I have tried to chug through some of the wp source code and my php knowledge 
   and wp knowledge leaves me a little wanting.
 * So my question. Is it possible to obtain this information and reoutput it in 
   the code above, for example:
 *     ```
       <?php
       if ( function_exists('register_sidebar') )
           register_sidebar(array(
           'before_widget' => '<div id="%1$s" class="widget entry %2$s">',
           'after_widget'  => '</div>',
           'before_title'  => '<h2 title="%title$" class="widgettitle">%1$',
           'after_title'   => '</h2>' ));
       ?>
       ```
   
 * Thanks

Viewing 1 replies (of 1 total)

 *  Thread Starter [atirez](https://wordpress.org/support/users/atirez/)
 * (@atirez)
 * [16 years, 6 months ago](https://wordpress.org/support/topic/get-widget-title/#post-1268953)
 * Sorry to bump this. But is it not possible or have I posted this in the wrong
   forum?

Viewing 1 replies (of 1 total)

The topic ‘Get Widget Title’ is closed to new replies.

 * 1 reply
 * 1 participant
 * Last reply from: [atirez](https://wordpress.org/support/users/atirez/)
 * Last activity: [16 years, 6 months ago](https://wordpress.org/support/topic/get-widget-title/#post-1268953)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
