I would do this in two pieces.
-
Add this into your functions.php file to grab custom fields globally:
function get_custom_field($key, $echo = FALSE) { global $post; $custom_field = get_post_meta($post->ID, $key, true); if ($echo == FALSE) return $custom_field; echo $custom_field;
}
-
Build your query as follows:
I can’t seem to get markdown to play nice, so here’s the code in Pastie http://pastie.org/1294594
Related Posts:
- Get posts from sites in Multisite?
- How To Modify The Loop in archives.php To Have 11 Posts Per Page and CSS Styling
- How can I hide a category from Contributors in the edit/add new post screen?
- WordPress Multiple Category Search
- Multiple Domain Names – One WP Install (non-Multisite) – Default Each Domain name to Category Archive
- how to use a different domain/subdomain for authors/catagories on single site?
- Delete a specific category when deleting a user
- List posts by category exclude current post
- How to list child categories in custom category template?
- Trash bin for categories
- How to set up sub-categories for author pages?
- View category in the preview of Theme Customizer
- Display only the latest post from multiple categories
- One WordPress Install, Two Categories. Each Category Gets a Domain
- Block multiple categories from Blog
- Create single.php for specific category by category id
- Show posts of one category only with Custom Taxonomy on single.php
- Return category slug / title from category ID
- Apply custom category template to subcategories
- Hide post meta data on a specific category
- Format Brand value in Category view [closed]
- Add custom taxonomy under the category title
- How to show in search results posts with a particular tag in a particular category?
- What is the advantage of using header-catname.php over is_category(‘catname’);?
- Remove ‘rel’ attributes from the_category() output
- Multiple menu items highlighted
- in_category() works in single.php but not in page.php?
- Use a wordpress page to display a certain category
- Multiple Category Search
- How do I add a function on a specific post category?
- Query posts by category AND custom field, then ORDERBY another custom field – help!
- How to customize category template?
- Category-slug.php not being used
- How would I go about adding custom header images per category?
- Checking for two categories in query_posts
- how to query posts and auto assign category if post title has keyword
- How to select posts from multiple categories and metavalues?
- Automatically exclude categories from metabox based on title
- query order by category
- Get link which associated with a specific category and tag
- How to categorize posts under Category 1 and Category 2 which are separate lists of categories, and display them as separate lists in widgets
- How to rewrite the post URL according to the category?
- Order by category titles
- Have parent category contain only one post?
- Display thumbnails for certain category posts
- Keyword search in multiple categories
- Randomly load categories with latest post
- Is it possible to remove from default category widget?
- How do I query_posts in cat=1 AND not in cat=2
- query_post order desc
- Two columns in homepage each with one category
- Pagination on category.php and tag.php not working
- Problem with different query loops (and “main loop”) on category template page!
- query_posts not reading correct categories
- Pagination for query_posts();
- Multiple selection for wordpress widget
- Different CSS class by category
- how to nest specific category thumbnails inside different containers
- Wrong category nice name is displayed on archive page
- Posts from a category on homepage with category archieves page default css
- function query_posts disabling current_page_menu class
- Remove any product that is featured from regular display loop [WooCommerce]
- Two Sections on Woocommerce Catergory Page [closed]
- query_posts by category_name and custom taxonomy
- Theme for subcategories
- Custom css per category and per single post belong in each category
- custom query for both category and pages using global $wpdb;
- I would like to feature a tip on the homepage
- wordpress taxonomy query posts
- SQL query to get posts from multiple categories but not in a category
- how can i hide category?
- wp_delete_term or wp_delete_category?
- Select posts that match multiple category names, must match all categories listed
- Last x Posted Categories?
- Exclude categories from postquery
- I need advice on how to structure the categories according to the layout i have
- show only sub categories if available?
- Sort posts alphabetically by category/custom taxonomy, insert divider between different types
- query_post problem
- Different post slug based on archive
- problem with filter of custom portfolio categories
- Deleted categories still listed until additional page refresh
- Category custom template is not showing correct posts
- Search Replace Database ONLY for posts of certain category?
- Assign a class to first element in category in loop
- Filter custom taxonomy posts via AJAX
- Need help to structure our a complex hierarchy
- Show posts from all categories
- How do you add Author and date Published on Category Pages?
- If it is a top level category show children otherwise show sibling categories
- display certain category on custom template page
- Paginate WordPress Category Pages
- How to have a category not show up in query post with page panigation?
- Query pages by category
- List all authors by matching custom meta data on a category page
- Showing one post from each category, paged?
- why is the delete option missing from just one category?
- How to prevent page re-sizing for mobile browsers [closed]
- Custom permalinks structure
- Woocommerce custom taxonomy order