Popular Posts - hide author and tags (1 post)

  1. calex3710
    Posted 3 years ago #

    Fairly new to PHP and am having some trouble making a minor tweak to a popular posts sidebar widget that a previous developer set up on a site. If anyone could help, that would be awesome.

    We need the popular posts list to show the title of the post, but not the author name or tags, which it currently shows. (The format is basically 'title - by author - tags').The previous developer seems to have been trying to do this via a string replace, but it wasn't working:

    if(!$ispage) { $title = str_replace('- by %author_name% - %tag%','',$title);
    		    $gaPopularPosts .= '<li><a href="'.$url.'">' . $title . '</a></li>';

    Any thoughts on what he was doing wrong, or what I can do to fix it?

    Thanks in advance for any help anyone can provide.

Topic Closed

This topic has been closed to new replies.

About this Topic