Popular Posts – hide author and tags
-
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>'; $thispage++; }
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.
- The topic ‘Popular Posts – hide author and tags’ is closed to new replies.