WordPress.org

Ready to get started?Download WordPress

Forums

[Plugin: Widget Logic] Using with TTFtitles (2 posts)

  1. bruinchiq
    Member
    Posted 6 years ago #

    I'm interested in setting up TTFtitles to work with renaming my widget titles, but I'm confused about where I need to makes edits in my code to accommodate this:

    I added this filter in order to render all widget titles with the excellent [ttftext plugin](http://templature.com/2007/10/18/ttftitles-wordpress-plugin/) like this:

    function ttftext_widget_title($content='', $widget_id='')
    {	preg_match("/<h2[^>]*>([^<]+)/",$content, $matches))
    	$heading=$matches[1];
    	$insert_img=the_ttftext( $heading, false );
    	$content=preg_replace("/(<h2[^>]*>)[^<]+/","$1$insert_img",$content,1);
    	return $content;
    }

    Where would I need to put this code? What changes do I need to make to it? And what additional code (and core page edits) would I need to make?

  2. alanft
    Member
    Posted 6 years ago #

    http://wordpress.org/extend/plugins/widget-logic/other_notes/

    The 'widget_content' filter
    Once this is active (by the option tickbox at the foot of the widget admin page) you can modify the text displayed by any widget. In your theme's functions.php file use:

    add_filter('widget_content', 'your_filter_function', [priority], 2);

    add the your_filter_function right after that - ie in your theme's functions.php file

Topic Closed

This topic has been closed to new replies.

About this Topic