• Resolved seto76

    (@seto76)


    hi hector,

    i noticed that your plugin shows a warning that the plugin is deprecated and it is recommended to replace it with the wordpress popular posts block or the wpp shortcode.

    since i work with elementor, i can’t use the widget anymore. so all i really have left is the shortcode.

    i copied your code from another post and unfortunately i don’t get it to display as before because i use your plugin as a page and not as a sidebar.

    could you please help me to adjust the shortcode so that the page still looks like before?

    the upper part on my test page is your shortcode. the lower part is how it always looked before.

    thank you very much in advance
    greetings sergio

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

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

    (@hcabrera)

    Hi @seto76,

    Alright, this would be the shortcode equivalent to your Popular Posts widget:

    [wpp range='last24hours' post_type='post' stats_views=0 stats_date=1 thumbnail_width=808 thumbnail_height=445 wpp_start='<ul class="wpp-list wpp-list-with-thumbnails">' wpp_end='</ul>']

    You may need to tweak some parameters as I don’t know how you have configured your popular posts widget.

    For example, the range parameter is set to “last24hours” – you may want to change that to whatever time range you’re using with the widget (valid values for the range parameter are ‘last24hours’, ‘last7days’, ‘last30days’, ‘all’, and ‘custom’, see Parameters for more details.)

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

    Thread Starter seto76

    (@seto76)

    thank you very much!

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

    (@hcabrera)

    No problem, this should do the trick:

    [wpp limit=5 order_by='views' cat=345 range='last24hours' post_type='post' stats_views=0 stats_date=1 thumbnail_width=808 thumbnail_height=445 wpp_start='<ul class="wpp-list wpp-list-with-thumbnails">' wpp_end='</ul>']
    Thread Starter seto76

    (@seto76)

    i just customized your shortcode for me, but now it doesn’t show me anything. did i do something wrong?

    [wpp range='last7days' freshness=1 post_type='post' stats_views=0 stats_date=1 stats_date=1 stats_date_format='d.m.Y' limit=5" order_by='comments'  cat='345' thumbnail_width=808 thumbnail_height=445 wpp_start='<ul class="wpp-list wpp-list-with-thumbnails">' wpp_end='</ul>']

    and is there actually also the possibility to insert a distance between the displayed posts or do i have to do that via css?

    thanks!

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

    (@hcabrera)

    Yep, you have an extra double quote in there right after limit=5 that shouldn’t be there. That’s probably breaking the shortcode when WordPress tries to parse it.

    Thread Starter seto76

    (@seto76)

    ok thanks.
    i have removed the quotation marks now, but it still doesn’t work.

    [wpp range='last7days' freshness=1
    post_type='post'
    stats_views=0
    stats_date=1
    stats_date=1
    stats_date_format='dmY'
    limit=5
    order_by='comments'
    cat='345'
    thumbnail_width=808
    thumbnail_height=445
    wpp_start='<ul class="wpp-list wpp-list-with-thumbnails">' wpp_end='</ul>']
    Plugin Author Hector Cabrera

    (@hcabrera)

    Alright, what exactly do you mean with “doesn’t show me anything”? Is it literally not showing anything on screen? Are you seeing the “Sorry, no data so far” message? Something else?

    Plugin Author Hector Cabrera

    (@hcabrera)

    Also, I hope you’re not using the shortcode like that (with line jumps) on your site. WordPress will automatically convert all line jumps it finds into paragraphs.

    Thread Starter seto76

    (@seto76)

    Alright, what exactly do you mean with “doesn’t show me anything”? Is it literally not showing anything on screen? Are you seeing the “Sorry, no data so far” message? Something else?

    i already understood that it says “sorry, no data so far”. but what i don’t understand is that the widget displays something underneath. how can that be? shouldn’t the shortcode display the same as the wpp widget?

    Also, I hope you’re not using the shortcode like that (with line jumps) on your site. WordPress will automatically convert all line jumps it finds into paragraphs.

    no, i didn’t. i just added line breaks to make it clearer and faster to read than displaying it in one long line.

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

    (@hcabrera)

    It might be a configuration issue. Double check that the settings that you’re using with the widget match with the ones you’ve set up with the shortcode. There must be something different, otherwise you’d get the exact same output.

    Feel free to share screenshots of the settings you’re using with the widget so I can help you figure out what’s going on.

    Thread Starter seto76

    (@seto76)

    Plugin Author Hector Cabrera

    (@hcabrera)

    It’s this:

    freshness=1

    The freshness parameter is instructing the plugin to find posts that were published within the last 7 days (as per your time range settings) and from those get the ones with the most comments (yes, comments, see below why).

    This parameter is the equivalent to the “Display only posts published within the selected Time Range” checkbox that’s under the Time Range dropdown on your screenshots. See how it’s not enabled there? ??

    You also have this:

    order_by='comments'

    And in your screenshots you’ve configured the widget to sort posts by views count, not by comments count.

    So yep, different settings, different results ??

    This would the the shortcode you’d want to use if you want it to behave exactly as the widget:

    [wpp range='last7days' post_type='post' stats_views=0 stats_date=1 stats_date_format='dmY' limit=5 order_by='views' cat='345' thumbnail_width=808 thumbnail_height=445 wpp_start='<ul class="wpp-list wpp-list-with-thumbnails">' wpp_end='</ul>']
    Thread Starter seto76

    (@seto76)

    perfect??!!! now it works!!!
    one last question … is there actually also the possibility to insert a distance between the displayed posts or do i have to do that via css?

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

    (@hcabrera)

    Ah, I saw your question about that earlier but forgot to reply. Yes, you should use CSS for styling related stuff. Let me know if you need a hand with that as well and I’ll gladly help.

    Thread Starter seto76

    (@seto76)

    if you do not mind, gladly.

Viewing 15 replies - 1 through 15 (of 18 total)
  • The topic ‘WordPress Popular Posts “classic” widget is going away!’ is closed to new replies.