Post order is not alphabetical in a custom post type (3 posts)

  1. borsato
    Posted 4 years ago #


    Someone programmed a specific plugin for a product catalog and uses custom post type. The problem is that the post are not displayed in alphabetical order on the frontend, this also includes the search results for the specific posts. (it is shown in alphabetical order in the backend).

    This is driving me crazy….

    Is there a workaround for this?

    Looking forward to a solution for this. I hope someone can point me in the right direction..

  2. David Gwyer
    Posted 4 years ago #

    It is probably sorting by publication date. Take a look at the CPT post query and modify the sort parameter.

  3. LucP
    Posted 4 years ago #

    The line to look for (or ADD) is:

    'order_by' => 'post_title'

    (if the line is visible it will probably say 'post_date' instead of 'post_title', so change it into 'post_title' and your good.)

Topic Closed

This topic has been closed to new replies.

About this Topic