Forums

Popular Posts Plugin Adds "3" to end of title in sidebar (2 posts)

  1. brevityness
    Member
    Posted 1 year ago #

    On my blog: http://loneplacebo.com/, I have the WP Popular Posts plugin installed and displayed in the sidebar. The title, " Current Hits:" is appended with a "3" at the end. Can't figure out why. It's driving me insane.

  2. sheldonbeswift
    Member
    Posted 1 year ago #

    I see that your blog LonePlacebo is pretty much dead, but perhaps this will help someone else:

    1. Open wordpress-popular-posts/wordpress-popular-posts.php in the plugin directory.
    2. Go to Line 129, the section of code should look like:
      // has user set a title?
      if ($instance['title'] != '') {
      	if ($instance['markup']['custom_html'] && $instance['markup']['title-start'] != "" && $instance['markup']['title-end'] != "" ) {
      		echo htmlspecialchars_decode($instance['markup']['title-start'], ENT_QUOTES) . $instance['title'], ENT_QUOTES . htmlspecialchars_decode($instance['markup']['title-end'], ENT_QUOTES);
    3. Replace the section above with this:
      // has user set a title?
      if ($instance['title'] != '') {
      	if ($instance['markup']['custom_html'] && $instance['markup']['title-start'] != "" && $instance['markup']['title-end'] != "" ) {
      		echo htmlspecialchars_decode($instance['markup']['title-start'], ENT_QUOTES) . htmlspecialchars_decode($instance['title'], ENT_QUOTES) . htmlspecialchars_decode($instance['markup']['title-end'], ENT_QUOTES);

    The issue was that the author set ENT_QUOTES outside of the htmlspecialchars() function.

Topic Closed

This topic has been closed to new replies.

About this Topic