• Resolved deka.jayanta

    (@dekajayanta)


    Hi,
    I intend to offset the posts (say 3) of one category while want all posts of another category visible in a WP Show Post list. When I key in any number in the “offset” under more settings, all the posts (irrespective of the categories) are offset by the said number. Can I just offset one category and not all the categories selected? Maybe it can be achieved by some codes…

Viewing 1 replies (of 1 total)
  • Hi @dekajayanta,

    You’re correct. If you use the offset in the “More settings” of a specific WPSP list as seen in the link below, the offset would apply to all categories.

    https://share.getcloudapp.com/NQuxlGQ0

    The solution we would suggest in this case is to create two lists. One with the specific category needing an offset and the other with none.

    Another approach would be adding a custom settings parameter in the shortcode of the specific WPSP list to query the specific category with a specific offset.

    For instance, you can try modifying your shortcode into something like this:

    [wp_show_posts id=“123” settings=“taxonomy=category&tax_term=categoryname&offset=3”]

    Then have another instance of this shortcode like this:

    [wp_show_posts id=“123” settings=“taxonomy=category&tax_term=categoryname2, categoryname3&offset=0”]

    Simply replace id to the corresponding list id, “categoryname” to the category name and the offset to your preference.

    Be weary though for a known WP bug with regards to paginations on the same page as it breaks offset.

    Hope this helps! ??

Viewing 1 replies (of 1 total)
  • The topic ‘Offset posts of one category only’ is closed to new replies.