WordPress.org

Ready to get started?Download WordPress

Forums

[Plugin: WordPress Popular Posts] Summary does not appear (6 posts)

  1. daymobrew
    Member
    Posted 4 years ago #

    I am trying to style a page with a list of the popular posts. I am using the WPP shortcode:

    [wpp range="all" cats_to_exclude="3,28,25,19" pages=0 order_by="views" wpp_start='<div class="popular-posts">' wpp_end="</div>" stats_comments=0 thumbnail_width=100 thumbnail_height=100 post_start='<div class="popular-post">' post_end="</div>" pattern_form="{image} {title}: {summary}"]

    The page: http://www.valueseekers.ie/most-popular-offers/
    The summary is not appearing. The listed posts do have content but I don't know how to make the summary appear - what is the summary?

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

  2. Héctor Cabrera
    Member
    Posted 4 years ago #

    Hi daymobrew,

    You're missing the do_pattern parameter. Your code should look like this:

    [wpp range="all" cats_to_exclude="3,28,25,19" pages=0 order_by="views" wpp_start='<div class="popular-posts">' wpp_end="</div>" stats_comments=0 thumbnail_width=100 thumbnail_height=100 post_start='<div class="popular-post">' post_end="</div>" do_pattern=1 pattern_form="{image} {title}: {summary}"]

    The summary is an excerpt of your post's contents. If you have defined one on the Excerpt box WPP will use that text as summary, otherwise it'll build one directly from your post's content.

    Hope that helps!

    P.S.: by the way, wpp_start / wpp_end are different from post_start / post_end. The first ones set the container's opening/closing tags of the popular listing, and the latter set the opening/closing tags of each post on the list. Why are you setting them with the same class?

  3. daymobrew
    Member
    Posted 4 years ago #

    Thanks for do_pattern info. Can you add a note about do_pattern to the pattern_form help info in wordpress-popular-posts.php. I can submit a diff patch to you.

    I have added do_pattern=1 but still no change.
    http://www.valueseekers.ie/most-popular-offers/
    I added text to the Excerpt box for the "Special beer offer at Tesco" but still nothing on the page.

    My page shortcode now has:
    [wpp range="all" cats_to_exclude="3,28,25,19" pages=0 order_by="views" wpp_start='<div class="popular-posts">' wpp_end="</div>" stats_comments=0 thumbnail_width=100 thumbnail_height=100 post_start='<div class="popular-post">' post_end="</div>" do_pattern=1 pattern_form="{image} {title}: {summary}"]

    I am using a different class for wpp_start and post_start: popular-posts vs popular-post (plural and singular). This is to allow styling of the area outside the posts.

  4. daymobrew
    Member
    Posted 4 years ago #

    I added excerpt_length=55 to the page shortcode and {summary} is now appearing.

    My page shortcode is now:
    [wpp range="all" cats_to_exclude="3,28,25,19" pages=0 order_by="views" wpp_start='<div class="popular-posts">' wpp_end="</div>" stats_comments=0 thumbnail_width=100 thumbnail_height=100 post_start='<div class="popular-post">' post_end="</div>" do_pattern=1 pattern_form="{image}<h2>{title}</h2><p>{summary}</p>" excerpt_length=100]

    I added excerpt_length=100 and changed pattern_form to pattern_form="{image}<h2>{title}</h2><p>{summary}</p>"

  5. daymobrew
    Member
    Posted 4 years ago #

    Aside: I think that do_pattern=1 should be implied when pattern_form is used and excerpt_length=55 (the default) should be implied when {summary} is specified in pattern_form.

    Is this possible? (It might require that pattern_form not have a default in wpp_shortcode()).

    Also, do you plan to use post-thumbnails for the wpp thumbnail? (or is complicated because you aren't using a standard loop to get post info)

  6. Héctor Cabrera
    Member
    Posted 4 years ago #

    Hi daymobrew, sorry for not replying earlier (out of town).

    I set a default value for pattern_form so people would have an idea on how to use this feature. Setting it to blank might confuse new users about its use, so I guess I'll have to find another way to make it more simple.

    About the thumbnails feature, I'm already working on some enhancements that hopefully should make it more robust.

    Thanks for your suggestions!

Topic Closed

This topic has been closed to new replies.

About this Topic