WordPress.org

Ready to get started?Download WordPress

Forums

WordPress Popular Posts
Extra Characters in list (">) (12 posts)

  1. apronstringsaflutter
    Member
    Posted 2 years ago #

    Hi. I created a layout here...

    http://sweetnessoflife.com/blog/most-popular-posts/

    But Im getting extra characters in the resulting list of popular posts...

    ">

    They are showing before the thumbnail and the post title. What am I missing?

    Thanks!

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

  2. Héctor Cabrera
    Member
    Plugin Author

    Posted 2 years ago #

    Hi there,

    Just checked your site. You're using the shortcode [wpp], right? How did you add the popular posts listing to that page?

  3. apronstringsaflutter
    Member
    Posted 2 years ago #

    Hi Hector...thanks for the response. Yes, Im using...

    [wpp limit='10' thumbnail_width='60' thumbnail_height='60' cats_to_exclude='15,16' range='all' stats_comments='0' order_by='comments' title_length='35']

    Am I doing something wrong in the shortcode?

    Thanks for your help!

  4. Héctor Cabrera
    Member
    Plugin Author

    Posted 2 years ago #

    Everything seems OK to me. I'm going to check it out and will come back to you as soon as I can - probably tomorrow. In the meanwhile, you might want to disable thumbnails until I find a fix for this.

  5. apronstringsaflutter
    Member
    Posted 2 years ago #

    Thank you! Yes, I tried that, but one still shows up before the post title so I dont think its associate with thumbnails? So weird!

  6. Héctor Cabrera
    Member
    Plugin Author

    Posted 2 years ago #

    Hey there,

    Just checked your site again and noticed that you're using images for posts' titles, right? That is what is breaking the plugin. When my plugin check for your posts' titles it gets a <img /> tag instead, then my plugin inserts that into your link's alt attribute and this is what is messing with your page's HTML, hence the extra > character.

    I also noticed that the HTML code on your page is slightly different from the original version in my plugin so I'm assuming you're using a modified version of WordPress Popular Posts, correct?

  7. apronstringsaflutter
    Member
    Posted 2 years ago #

    I was wondering if it was conflicting with another plugin. No, I think Im using the one that I downloaded from WP plugin page. I didnt change anything in the HTML...just inserted the short code on the page.

    Drat. Thanks for checking though...I appreciate getting responses from developers!

  8. Héctor Cabrera
    Member
    Plugin Author

    Posted 2 years ago #

    No problem, I do like to take some time to help others whenever I can.

    I did find, however, a flaw in my plugin. I'm not entirely sure it is what is causing the problem you described but it won't hurt to check.

    1. Using an editor such as Notepad or Dreamweaver, open wordpress-popular-posts.php
    2. Find the function generate_post_thumbnail (should be around line 810).
    3. Replace it with this code.
    4. Save changes.

    This fixes an extra <a /> tag created by that function by mistake. It'll still instert your <img /> tag instead of a text title though, so it should keep breaking your HTML anyway.

    I already included this change in the current version of WordPress Popular Posts (version 2.2.1 at the time of writing), so future downloads will include this fix.

  9. apronstringsaflutter
    Member
    Posted 2 years ago #

    Thanks Hector, it doesnt seem to fit the conflict with the other plugin but I appreciate you trying! Thanks gain...

  10. alturnwall
    Member
    Posted 2 years ago #

    Hector, thanks for your responses thus far.

    That pastebin doesn't seem to be working anymore :(

    I'm having a similar issue when using wp-typography—which inserts spans in the title of some posts around different characters like quotes and ampersands, which are in turn being pulled into the results for WPP.

    It looks like strip_tags isn't working for the titles.

    I looked through the wordpress-popular-posts.php file, but I'm not sure which section of the code applies to users who are using get_mostpopular() as opposed to the widget.

    Any tips?

    Thanks much...

  11. Héctor Cabrera
    Member
    Plugin Author

    Posted 2 years ago #

    Hi alturnwall,

    The get_popular_posts function is what you're looking for. Both the widget and the get_mostpopular function use it to retrieve the posts list.

  12. alturnwall
    Member
    Posted 2 years ago #

    Got it. Thanks.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic