ThemeShaper Forums » Thematic

[closed]

Changing Thematic Widgets a Little...

(7 posts)
  • Started 10 years ago by eddiej
  • Latest reply from Chris
  • This topic is resolved

Tags:

  1. Hey folks,
    I'm wondering is there a simple way to override the default widgets.php file of the thematic parent theme in my child theme. All I want to do is add a span tag inside the h3 tags of each widget heading. I could do this easily in the parent widgets.php but would like to do it in my child theme. I tried to do it by copying the thematic_widgets_init function and calling it something else (and removing the thematic_widgets_init action from init and adding my new action) but it didn't work.
    Cheers,
    Eddie

    Posted 10 years ago #
  2. Hey Eddie,

    if you could wait 'til tomorrow, I should have an easy solution for you. Need to do some tests first.

    Cheers,

    Chris

    Posted 10 years ago #
  3. No worries Chris, I appreciate any sort of advice but don't go to any bother

    Posted 10 years ago #
  4. Hey Eddie,

    get the latest version from our SVN repository.

    Add the following code to your child theme's functions.php:

    function my_before_title($content) {
    	$content = "<h3 class=\"widgettitle\"> <span class=\"whatever\">";
    	return $content;
    }
    add_filter('thematic_before_title', 'my_before_title');
    
    function my_after_title($content) {
    	$content = "</span\n</h3\n";
    	return $content;
    }
    add_filter('thematic_after_title', 'my_after_title');

    This will only work with widgets added in wp-admin / appearance / widgets .. It's not working with the pre-configured widgets.

    Cheers,

    Chris

    Posted 10 years ago #
  5. super stuff, works a treat.

    Posted 10 years ago #
  6. Hi Chris,
    I did a presentation on Frameworks at WordCamp Ireland a few days ago which this forum post (and your help!) featured in :-) The slides and notes are available from http://www.wordcampireland.com/speakers/eddie-johnston/.
    Thanks again,
    Eddie

    Posted 9 years ago #
  7. Thanks a lot, Eddie :)

    Posted 9 years ago #

RSS feed for this topic

Topic Closed

This topic has been closed to new replies.