![]() |
|
||||||
|
|
Thread Tools | Display Modes |
|
#1
|
|||
|
|||
|
Hi,
I am working on setting up a category page with featured posts first by assigning them an order based on a custom value 'featured' and a number value (1,2,3 etc). My php is a bit rusty and this is what I have right now, the problem is that it only shows posts that have a featured custom value. If there is none assigned then it won't show in the category. I would prefer to show the three featured items first, then have a full list below, maybe by alpha order, maybe by date or whatever I choose. What do I need to add to the query to make this happen. Thanks in advance. /** order by featured */ add_action('genesis_before_loop', 'custom_sort'); function custom_sort () { if (is_category('3')) { global $query_string; query_posts($query_string . "&orderby=meta_value&meta_key=featured&order=asc") ; } } |
| Thread Tools | |
| Display Modes | |
|
|
© Copyright 2012 Copyblogger Media LLC · StudioPress™ is a trademark of Copyblogger Media LLC
Privacy Policy | Refund Policy | Terms of Service | Affiliate Program | Contact Us