WordPress.org

Ready to get started?Download WordPress

Forums

WordPress Popular Posts
[resolved] [Plugin] wpp_get_mostpopular; pattern_form parsing issue (4 posts)

  1. zeshark
    Member
    Posted 1 year ago #

    Hi,
    Very cool plugin, trying to get it to work for me. My goal is to display most popular posts as thumbnails only in our theme.

    I am using the following line:
    <?php wpp_get_mostpopular("range=monthly&order_by=views&limit=5&post_type=post&thumbnail_width=200&stats_comments=0&do_pattern=1&pattern_form="{image}""); ?>
    but I get a parsing error on the { and I do not understand why.
    Help much appreciated !

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

  2. Héctor Cabrera
    Member
    Plugin Author

    Posted 1 year ago #

    Hi zeshark,

    You made a mistake in your code. Replace the double quotes in pattern_form="{image}" with single quotes. It should be:

    <?php wpp_get_mostpopular("range=monthly&order_by=views&limit=5&post_type=post&thumbnail_width=200&stats_comments=0&do_pattern=1&pattern_form='{image}'"); ?>

  3. zeshark
    Member
    Posted 1 year ago #

    Many thanks for your reply, I will try that.
    I was reading off the FAQ tab on the plugin config in WordPress, they do say:

    pattern_form="{image} {title}: {summary} {stats}"

    You may want to put this on your list of mods for the next release.

  4. Héctor Cabrera
    Member
    Plugin Author

    Posted 1 year ago #

    The info in the FAQ is correct. However, in PHP when using double quotes in a string and you want to add another string in it you need to use single quotes. That's why it was causing the error. I will update the FAQ to correct the double quotes, though.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic