Adding markup to widgets
-
I’m trying to turn a widget into a link (entire widget – title and content). I’m using the cyberchimps responsive free theme on wordpress 3.8. I’m trying to unregister a widget and then re-register the same widget with markup on before_title => and after_widget =>.
This works perfectly when I add it to the functions.php of the parent theme but it doesn’t seem to work if I add it to my child theme. This is the code I am using:
unregister_sidebar('home-widget-1'); register_sidebar( array( 'name' => __( 'Home Widget 1', 'responsive' ), 'description' => __( 'Area 6 - sidebar-home.php - Displays on the Home Page', 'responsive' ), 'id' => 'home-widget-1', 'before_title' => '<a href="https://example.com"><div id="widget-title-one" class="widget-title-home"><h3>', 'after_title' => '</h3></div>', 'before_widget' => '<div id="%1$s" class="widget-wrapper %2$s">', 'after_widget' => '</div></a>' ) );
What is the best approach in this situation? Do I need to make all new widgets or can I do what I’m trying to do in another way?
Thanks!
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘Adding markup to widgets’ is closed to new replies.