Display Posts Shortcode
[resolved] Alphabetical Order not working... (4 posts)

  1. FlourishDesignStudio
    Posted 4 years ago #

    Hi there! I have added the following code to my page but for some reason, it will not let me sort alphabetically. I had the same problem with another plugin.

    [display-posts category="recipe" posts_per_page="-1" include_date="true" order="ASC" orderby="date"]

    Here's the page where the list appears and you can clearly see that the list is not in alphabetical order: http://www.moosewoodcooks.com/all-recipes/

    Can someone help me figure out why?? Please? Thanks SO much!


  2. Bill Erickson
    Plugin Author

    Posted 4 years ago #

    The issue is that you're not asking it to sort it alphabetically - you're sorting it by date. Change it to:

    [display-posts category="recipe" posts_per_page="-1" include_date="true" order="ASC" orderby="title"]

    More info: http://codex.wordpress.org/Class_Reference/WP_Query#Order_.26_Orderby_Parameters

  3. FlourishDesignStudio
    Posted 4 years ago #

    Hi Bill! Thank you SO much for responding. Sorry, I reealize that I pasted the wrong code when I saw your response (I had tested to see if I got different results when I tried sorting by date or alphabetically- but I got the same result).

    But, just in case, I just pasted the code that you provided, updated the page, and I am still getting them sorted by date, even though that's not what the code calls for. Any ideas?

    Thanks again!

  4. Bill Erickson
    Plugin Author

    Posted 4 years ago #

    I just tested it with no plugins running and on the TwentyEleven theme and it sorts alphabetically.

    My guess is you have a theme or plugin that is interacting with WordPress queries. To see if it's the theme, switch to the default theme and see if the order is correct. If not, switch back to your regular theme and disable plugins one by one.

    Once you've identified if it's a theme or plugin, you can decide if you want to just not use that theme/plugin or hire a developer to solve the actual issue in the theme/plugin.

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • Display Posts Shortcode
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic