WordPress.org

Forums

WordPress Popular Posts
[Plugin: WordPress Popular Posts] " class=wpp-post-title" (11 posts)

  1. soli004
    Member
    Posted 2 years ago #

    I get this " class=wpp-post-title" on certain posts when I use the widgets in the sidebar. I have no clue why this happens. Have a look at http://www.digitalworkflow.se and check the sidebar for the widgets, several of them has this on the titles. I also have a blogpost (Adobe Photoshop CS5) that is not working anymore, I get only an image and strange behavior, looks like it has been broken after the upgrade, but I am not 100% sure it happened during the upgrade, but I did have error messages when upgrading the plugin, this one also have the strange " class=wpp...".

    This was not a problem with earlier version of your plugin!

    Thanks for the time

    http://wordpress.org/extend/plugins/wordpress-popular-posts/

  2. Héctor Cabrera
    Member
    Plugin Author

    Posted 2 years ago #

    Hi soli004,

    The wpp-post-title class has been present since earlier versions of the plugin, I don't understand your question.

  3. soli004
    Member
    Posted 2 years ago #

    Hector!

    If you look at http://www.digitalworkflow.se at the widgets you have the "class=..etc showing in the widgets together with the title. I dont want this... I only want the title to show. Did you have a look?

    Thanks

  4. Héctor Cabrera
    Member
    Plugin Author

    Posted 2 years ago #

    Yes, sorry. I took a quick look and didn't see what the problem was and just checked it again and know what you meant.

    Problem is that you're using html tags inside some of your posts titles, that's what is breaking only some of them. My plugin does attempt to remove all HTML tags from titles, but for some reason some of your posts titles still passed a few malformed HTML tags.

    I just reuploaded a fix, please download the plugin again in 30 minutes or so (it will still be version 2.3.1) and install it.

  5. soli004
    Member
    Posted 2 years ago #

    Hi Hector,

    I am not using any html tags inside the post titles only in the blogposts!
    I tried downloading the updates but it did not change anything!

    Thanks

  6. soli004
    Member
    Posted 2 years ago #

    What I can see in two of the "errors" is that I am using "..." in the post title. Can this be the problem? But then I have one post not having "..." in the post title but still have the "class= error", but this post is broken for some reason... http://www.digitalworkflow.se/adobe-photoshop-cs5/

    Thanks

  7. soli004
    Member
    Posted 2 years ago #

    I did also deactivate and activate the plugin and got the following error message!

    " The plugin generated 434 indices of unexpected data (unexpected output) during activation. If you get error messages of the type "headers already sent", problems with flows or other errors, try inactivate or remove this plugin.

    ??

  8. Héctor Cabrera
    Member
    Plugin Author

    Posted 2 years ago #

    If you check at your site's source code, this is what is being printed at your Photoshop's post:

    <a href="http://www.digitalworkflow.se/adobe-photoshop-cs5/" title="Adobe Photoshop <span class=" caps"="">CS<span class="numbers">5</span>" class="wpp-post-title">Adobe Photoshop <span class="caps">CS<span class="numbers">5</span></span></a>

    Problem is that your post title has malformed HTML in it. When inserted into the title attribute, things get broken.

  9. soli004
    Member
    Posted 2 years ago #

    Hector,

    I did find the problem!

    I am using a plugin with name "wp-Typography" it makes the error in your plugin!

    Any chance you will have a look on this?

    http://kingdesk.com/projects/wp-typography/

    Thanks

  10. Héctor Cabrera
    Member
    Plugin Author

    Posted 2 years ago #

    Sure, I will once I get some spare time.

    For the time being, and to prevent the bug from showing on your sidebar, do the following:

    # Open wordpress-popular-posts.php using a text editor such as Dreamweaver or Notepad.

    # Find this piece of code:

    $data = array(
        'title' => '<a href="'.$permalink.'" title="'.$title.'">'.$title_sub.'</a>',
        'summary' => $excerpt,
        'stats' => $stats,
        'img' => $thumb,
        'id' => $p->id
    );
    
    array_push($posts_data, $data);
    
    // PUTTING IT ALL TOGETHER
    if ($instance['markup']['custom_html']) { // build custom layout
        if ($instance['markup']['pattern']['active']) {
            $content .= htmlspecialchars_decode($instance['markup']['post-start'], ENT_QUOTES) . htmlspecialchars_decode($this->format_content($instance['markup']['pattern']['form'], $data, $instance['rating'])) . htmlspecialchars_decode($instance['markup']['post-end'], ENT_QUOTES) . "\n";
        } else {
            $content .= htmlspecialchars_decode($instance['markup']['post-start'], ENT_QUOTES) . "{$thumb}<a href=\"{$permalink}\" title=\"{$title}\" class=\"wpp-post-title\">{$title_sub}</a> {$excerpt}{$stats}{$rating}" . htmlspecialchars_decode($instance['markup']['post-end'], ENT_QUOTES) . "\n";
        }
    } else { // build regular layout
        $content .= "<li>{$thumb}<a href=\"{$permalink}\" title=\"{$title}\" class=\"wpp-post-title\">{$title_sub}</a> {$excerpt}<span class=\"post-stats\">{$stats}</span>{$rating}</li>" . "\n";
    }

    # ... and replace it with:

    $data = array(
        'title' => '<a href="'.$permalink.'">'.$title_sub.'</a>',
        'summary' => $excerpt,
        'stats' => $stats,
        'img' => $thumb,
        'id' => $p->id
    );
    
    array_push($posts_data, $data);
    
    // PUTTING IT ALL TOGETHER
    if ($instance['markup']['custom_html']) { // build custom layout
        if ($instance['markup']['pattern']['active']) {
            $content .= htmlspecialchars_decode($instance['markup']['post-start'], ENT_QUOTES) . htmlspecialchars_decode($this->format_content($instance['markup']['pattern']['form'], $data, $instance['rating'])) . htmlspecialchars_decode($instance['markup']['post-end'], ENT_QUOTES) . "\n";
        } else {
            $content .= htmlspecialchars_decode($instance['markup']['post-start'], ENT_QUOTES) . "{$thumb}<a href=\"{$permalink}\" class=\"wpp-post-title\">{$title_sub}</a> {$excerpt}{$stats}{$rating}" . htmlspecialchars_decode($instance['markup']['post-end'], ENT_QUOTES) . "\n";
        }
    } else { // build regular layout
        $content .= "<li>{$thumb}<a href=\"{$permalink}\" class=\"wpp-post-title\">{$title_sub}</a> {$excerpt}<span class=\"post-stats\">{$stats}</span>{$rating}</li>" . "\n";
    }

    # Save changes.

  11. soli004
    Member
    Posted 2 years ago #

    Hector,

    Thanks alot! That did the trick!

    Great service and amazing work!

    Regards

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • WordPress Popular Posts
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic