Tagged: change tag, filter, widget title
-
AuthorPosts
-
August 6, 2016 at 2:25 pm #669310
Hi Enfold Team,
Some weeks ago, Ismael gave me a filter to change the H3 tag on standard widget titles (displayed everywhere).
Here is the thread : https://kriesi.at/support/topic/change-template-code-in-child-theme/
I’m adding the filter code at the end of this emailI would like to do the same thing on a “Sidebar blog” widget (in this case an Enfold “Latest news” widgets.
Example here, in the sidebar (my title …) : http://586814b516.url-de-test.ws/enfoldsupport/blog/Any way to do this ?
Many thanks for your help
Hi!
You have to unregister the existing widget areas then register it back. Example:
function ava_remove_some_widgets(){
unregister_sidebar( ‘av_everywhere’ );register_sidebar(array(
‘name’ => ‘Displayed Everywhere’,
‘before_widget’ => ‘<section id=”%1$s” class=”widget clearfix %2$s”>’,
‘after_widget’ => ‘<span class=”seperator extralight-border”></span></section>’,
‘before_title’ => ‘<h2 class=”widgettitle”>’,
‘after_title’ => ‘</h2>’,
‘id’=>’av_everywhere’
));
}
add_action( ‘widgets_init’, ‘ava_remove_some_widgets’, 11 );
This code in the functions.php file will unregister the “Displayed Everywhere” widget area and then register it back with the “h2” as widget title.Regards,
IsmaelAugust 9, 2016 at 7:12 pm #670501Hey ouranos3,
Please add following code to functions.php file of your child theme as well
function ava_remove_some_widgets_blog(){ unregister_sidebar( 'av_blog' ); register_sidebar(array( 'name' => 'Sidebar Blog', 'before_widget' => '<section id="%1$s" class="widget clearfix %2$s">', 'after_widget' => '<span class="seperator extralight-border"></span></section>', 'before_title' => '<h2 class="widgettitle">', 'after_title' => '</h2>', 'id'=>'av_blog' )); } add_action( 'widgets_init', 'ava_remove_some_widgets_blog', 11 );
Best regards,
YigitAugust 9, 2016 at 8:18 pm #670519Thanks, Yigit, perfect.
August 9, 2016 at 9:04 pm #670526Hey!
Please do let us know if you need anything else, we will be happy to assist.
Regards,
Basilis -
AuthorPosts
- You must be logged in to reply to this topic.