• Resolved vlvshein

    (@vlvshein)


    Tell me how to specify the category selection in the short code so that the widget displays popular posts from the specified categories. Thank you.

    • This topic was modified 1 year, 3 months ago by vlvshein.

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

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

    (@hcabrera)

    You can use the cat parameter to get the shortcode to list the most popular posts from a specific category ID, like so for example:

    [wpp cat='25']

    See Parameters for more details.

    Thread Starter vlvshein

    (@vlvshein)

    I use the following code. Please see if everything is correct. And how do I add a category here?

    [wpp post_type=post limit=5 wpp range='last1days' wpp range='custom' time_quantity=1 time_unit='day' wpp_start='<ol class="wpp-views">' wpp_end='</ol>' wpp_start='<ol class="wpp-list">' wpp_end='</ol>' stats_taxonomy=true wpp cat='14']
    • This reply was modified 1 year, 3 months ago by vlvshein.
    Thread Starter vlvshein

    (@vlvshein)

    I did this. Posts from all categories are displayed, but only 14 categories are needed.

    Plugin Author Hector Cabrera

    (@hcabrera)

    You have “wpp” multiple times in your shortcode which is probably confusing WordPress. The parameters range, wpp_start and wpp_end are duplicated too. stats_taxonomy needs to be either 1 or 0 so I fixed that too.

    Here’s the revised version:

    [wpp post_type='post' limit=5 range='custom' time_quantity=1 time_unit='day' wpp_start='<ol class="wpp-list">' wpp_end='</ol>' stats_taxonomy=1 cat='14']

    Is 14 the ID of your category?

    Thread Starter vlvshein

    (@vlvshein)

    Yes, 14 and 22 are category id

    Thread Starter vlvshein

    (@vlvshein)

    I inserted your code. Posts from all categories are displayed.

    Plugin Author Hector Cabrera

    (@hcabrera)

    Alright, where’s your shortcode exactly so I can have a look?

    Thread Starter vlvshein

    (@vlvshein)

    The widget with the code is located on the main page. rifmo.ru . I showed it in the screenshot. There is 1 post under the number, which should not be displayed in the widget. He is in another category #77.

    https://ibb.co/5tg6XPS

    Plugin Author Hector Cabrera

    (@hcabrera)

    That’s odd. Would it be possible for you to provide a copy of the following database tables so I can test myself and see what’s going on?

    • wp_options
    • wp_popularpostsdata
    • wp_popularpostssummary
    • wp_popularpoststransients
    • wp_postmeta
    • wp_posts
    • wp_termmeta
    • wp_terms
    • wp_term_relationships
    • wp_term_taxonomy
    Thread Starter vlvshein

    (@vlvshein)

    Where can I send you copies of the database?

    Plugin Author Hector Cabrera

    (@hcabrera)

    Please use my contact form.

    Thread Starter vlvshein

    (@vlvshein)

    I filled out the form

    Thread Starter vlvshein

    (@vlvshein)

    I have sent you an email.

    Plugin Author Hector Cabrera

    (@hcabrera)

    Issue resolved. OP was editing the wrong shortcode πŸ˜›

Viewing 14 replies - 1 through 14 (of 14 total)

The topic ‘Popular posts from the specified category’ is closed to new replies.