Widget Customizing Issue with Replaced Widgets for before_title and after title
-
Using the function.php, I am having an issue with the before_title and after_title not being recognized for custom widget defined in function.php which replaces the default widget. When using default widget, it’s tags set in function.php function as expected. The before_widget and after_widget function properly with both default and customized widgets.
The code below in case I am missing anything or this is a bug. Any ideas?
To customize widget coding for before/after tags as found in function.php prior to customized widgets:
<?php if ( function_exists('register_sidebar') ) register_sidebar(array( 'before_widget' => '<div id="%1$s" class="sideblock?%2$s">', 'after_widget' => '</div>', 'before_title' => '<h3>', 'after_title' => '</h3>', )); ?>
To replace the default Search Widget found in function.php after the above code:
<?php function widget_mytheme_search() { ?> <?php echo $before_widget; ?> <?php echo $before_title . 'Search' . $after_title; ?> customized code here <?php echo $after_widget; ?> <?php } if ( function_exists('register_sidebar_widget') ) register_sidebar_widget(__('Search'), 'widget_mytheme_search'); ?>
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘Widget Customizing Issue with Replaced Widgets for before_title and after title’ is closed to new replies.