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

  1. zeshark
    Posted 3 years ago #

    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 !


  2. Hector Cabrera
    Plugin Author

    Posted 3 years 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
    Posted 3 years 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. Hector Cabrera
    Plugin Author

    Posted 3 years 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

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

About this Topic