This is searchable archive of our old support forums, which operated from 2012 - 2016. To find out how to get support for your current theme, please visit our support page.


Modifying HTML for Widget Areas Plugin

  • Creator
  • #8372

    Hi Jason,

    I have a complicated CSS thing I need to do to widget titles on a site and need to add a span tag to the before and after widget title for custom widget areas. I see in the Widget Areas plugin tb-sidebars.php file the following code:

    function themeblvd_register_custom_sidebars() {
    	// Get custom sidebars
    	$custom_sidebars = get_posts( 'post_type=tb_sidebar&numberposts=-1&orderby=title&order=ASC' );
    	// Register custom sidebars
    	foreach( $custom_sidebars as $sidebar ) {
    		// Setup arguments for register_sidebar()
    		$args = array(
    			'name' 			=> __( 'Custom', 'themeblvd_sidebars' ).': '.$sidebar->post_title,
    		    'id' 			=> $sidebar->post_name,
    		    'before_widget' => '<aside id="%1$s" class="widget %2$s"><div class="widget-inner">',
    			'after_widget' 	=> '</div></aside>',
    			'before_title' 	=> '<h3 class="widget-title"><span>',
    			'after_title' 	=> '</span></h3>'
    		$location = get_post_meta( $sidebar->ID, 'location', true );
    		if( $location && $location != 'floating' )
    			$args['description'] = sprintf( __( 'This is a custom widget area to replace the %s on its assigned pages.', 'themeblvd_sidebars' ), themeblvd_get_sidebar_location_name( $location ) );
    			$args['description'] = __( 'This is a custom floating widget area.', 'themeblvd_sidebars' );
    		// Register the sidebar
    		register_sidebar( $args );

    You can see where I’ve added my tag, but, of course, if the plugin is updated, that is going to get overwritten. Any suggestions on how I should modify this? I’ve got it all working for the Jump Start widget area locations, just not these widget areas created by the plugin.

Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.