• Resolved trishahdee

    (@trishahdee)


    Your plugin is great. I’m using it to display pages and three CPTs using tabs. Alphabetical order is good for three out of the four. However, one CPT is for news and it makes more sense for that list/tab to be ordered by date. Is this possible? Or am I just wanting to have my cake and eat it, too? 🙂

Viewing 7 replies - 1 through 7 (of 7 total)
  • Plugin Author David Gwyer

    (@dgwyer)

    Hi Trisha, Thanks for the kind words, much appreciated! Using the built-in tabs is a little restrictive if you need different settings for each sitemap tab.

    However, if you display your own tabs then simply add a sitemap shortcode inside each tab with the specific settings required for each sitemap. This will give you maximum control over each of the tab sitemap settings.

    Hope that helps! 🙂

    Thread Starter trishahdee

    (@trishahdee)

    Great idea! I have set up a template using Bootstrap 5 tabs and different shortcodes in each tab. The problem is the News tab will not sort by date, it is still alphabetical. Here is that template code I am using for the News shortcode:

    <?php echo do_shortcode('[simple-sitemap types="news-and-events" orderby="date" order="desc"]'); ?>

    Can you see any reason why the orderby date would not be working?

    Plugin Author David Gwyer

    (@dgwyer)

    Are you using the free or pro version of the plugin?

    Thread Starter trishahdee

    (@trishahdee)

    Free.

    Plugin Author David Gwyer

    (@dgwyer)

    I just set up a test post type for news and created 5 sample posts, each published on a different date. The shortcode you provided seems to work perfectly for me. Here is a screenshot: https://ibb.co/svqbzJB8

    The only thing I can think of is it’s a side effect of the do_shortcode() PHP call or something specific with the particular news CPT you are using.

    Thread Starter trishahdee

    (@trishahdee)

    Wow. This is embarrassing. I still had the original shortcode in the shortcode block in the editor when I added my tabs and the new individual shortcodes to the template. I was seeing the original tabs at the top of the page and never scrolled down to see new tabs below them. Ugh. I’m sorry to have wasted your time. Everything is good now. Thank you.

    Plugin Author David Gwyer

    (@dgwyer)

    No problem Trisha, glad you got it sorted. 🙂

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

The topic ‘Sort by date for just one tab?’ is closed to new replies.