• Resolved foxeye

    (@foxeye)


    I created a ‘Page of posts’ listing all posts of 1 category. Default sortordered by title like this:
    'orderby' => 'title',

    now I would like the posts to be ordered by it’s excerpt field so changed it to this
    'orderby' => 'excerpt',

    or the_excerpt but doesn’t work. Am I acting to simple here?

Viewing 2 replies - 1 through 2 (of 2 total)
  • The excerpt is not one of the allowed orderby values.

    You could use the excerpt, or the content if no excerpt, in the sort by using a filter. But, the problem is that the excerpt (and content) probably contain html tags in addition to the visible text. Trying to sort on either will include the html in the sort but it will not show in the results. This apparently results in a ‘messed up’ sort.

    Thread Starter foxeye

    (@foxeye)

    I see. I’ll try to use a custom field instead.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘sort post by excerpt’ is closed to new replies.