• Resolved richesio

    (@richesio)


    Hi there,

    We currently use the widget and we have the ‘The WordPress Popular Posts classic widget is going away’ message.

    How would we create a shortcode to look and work like what we have already? I’ve included the link to what we have already.

    Any help would be much appreciated.

    The page I need help with: [log in to see the link]

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author Hector Cabrera

    (@hcabrera)

    Hi @richesio,

    Alright, please follow these instructions:

    #1 Place a Text widget on your sidebar and set its title as Trending.

    #2 Paste the following shortcode inside the Text widget and save changes.

    [wpp range='last24hours' post_type='post' thumbnail_width=484 thumbnail_height=272 wpp_start='<ul class="wpp-list wpp-list-with-thumbnails">' wpp_end='</ul>']

    The only thing in there that you may want/need to adjust is the range parameter so its value matches what you’re currently using with the widget (on the widget you’ll find it as Time Range). The range parameter accepts the following values: last24hours, last7days, last30days, all, custom (see Parameters for more details).

    If you have any further comments/questions please let me know.

    Thread Starter richesio

    (@richesio)

    Brilliant, thank you.

    • This reply was modified 1 year, 3 months ago by richesio.
    Plugin Author Hector Cabrera

    (@hcabrera)

    Oh, there’s one more parameter that you may want to use @richesio: limit. By default the shortcode will pull the top 10 posts, you may want to tweak that as I think it was previously showing 5 posts? For example:

    [wpp range='last24hours' limit=5 post_type='post' thumbnail_width=484 thumbnail_height=272 wpp_start='<ul class="wpp-list wpp-list-with-thumbnails">' wpp_end='</ul>']
    Thread Starter richesio

    (@richesio)

    Ah perfect.

    I checked the GitHub link and was able to pull through posts from certain categories too.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Create a shortcode to replace classic widget’ is closed to new replies.