Support » Fixing WordPress » Sort Category Page Listings by Custom Field

  • I have a custom field for my pages titled membership_level where it will either be Free or Premium. When you go to the category pages, I want the premium pages to be listed first and then the free pages. I want them to be ordered alphabetically second. This way, you have all premium pages listed from A – Z and then the free pages listed from A – Z.

    I have read a lot of forums on this and have seen tidbits of code, but I don’t even know where to start in putting the code to get my pages ordered correctly. I have looked for an “orderby” section in my PHP and can’t seem to find it.

    I am using the Clean Retina Theme and I don’t seem to have a categories.php page.

    Any help would be greatly appreciated!

Viewing 1 replies (of 1 total)
  • I’m not familiar with that theme, you might have better luck going to the theme support page and asking there as you need to know where to put the code first before you get the code snippet. Maybe look for archive.php as well. Having said that, these days with all the includes and complicated child themes, I don’t blame you for not being able to find it… gone are the days of just using the good ole template tags in the WP documentation 🙁

    Here’s a link to the code you need…

Viewing 1 replies (of 1 total)
  • The topic ‘Sort Category Page Listings by Custom Field’ is closed to new replies.