Viewing 4 replies - 1 through 4 (of 4 total)
  • Hi Jack,
    You can find the plugin’s hooks documentation and example here.

    With the feedzy_meta_output hook, you can do something like this:

    function bweb_feedzy_author_to_blog_matches( $matches ) {
        $domain = parse_url( $matches[1] );
        return '<a href="' . $matches[1] . '" target="_blank" rel="nofollow" title="' . $domain["host"] . '">' . $domain["host"] . '</a>';
    }
    function bweb_feedzy_author_to_blog( $content, $feedURL ) {
        if( 'http://b-website.com/feed' == $feedURL ) {
    		$pattern= '/<a.*href=\"(https?:\/\/.*)\".*>(.*)<\/a>/iU';
    		$content= preg_replace_callback( $pattern, 'bweb_feedzy_author_to_blog_matches', $content );
    	}
    	return $content;
    }
    add_filter( 'feedzy_meta_output', 'bweb_feedzy_author_to_blog', 9, 2 );

    By the way, you have to replace http://b-website.com/feed by the right feed’s URL or simply remove this condition.

    Cheers

    Thread Starter JackGraal

    (@jackgraal)

    Hi, thanks for replay.

    I’ve added the hook, but it still displays the author’s name.

    Example page with Feedzy widget: http://jackgraal.com/pl/polecam/

    Hi again,
    Well, because you agregate multiple feeds at the same time, it’s easier for you to remove the condition based on the feed’s URL.
    Update your function with the following:

    function bweb_feedzy_author_to_blog_matches( $matches ) {
        $domain = parse_url( $matches[1] );
        return '<a href="' . $matches[1] . '" target="_blank" rel="nofollow" title="' . $domain["host"] . '">' . $domain["host"] . '</a>';
    }
    function bweb_feedzy_author_to_blog( $content, $feedURL ) {
    	$pattern= '/<a.*href=\"(https?:\/\/.*)\".*>(.*)<\/a>/iU';
    	$content= preg_replace_callback( $pattern, 'bweb_feedzy_author_to_blog_matches', $content );
    	return $content;
    }
    add_filter( 'feedzy_meta_output', 'bweb_feedzy_author_to_blog', 9, 2 );

    Cheers

    Thread Starter JackGraal

    (@jackgraal)

    Awesome, thanks for your help 🙂

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Display blog name instead of author’ is closed to new replies.