Create menu based on Custom Fields
-
Hi Support,
I currently have a page that is displaying posts from a particular category ‘portfolio’ in a grid format. I have also added in extra custom fields for each of the posts and would like to use these as a filter to display appropriate posts.
This is the current code I am using:
<?php
$page = (get_query_var(‘paged’)) ? get_query_var(‘paged’) : 1;
if($_GET[“filter”] == “clear”)
query_posts(“category_name=portfolio&showposts=12&paged=$page”);
else
$filter = $_GET[“filter”];
$value = $_GET[“value”];
query_posts(“category_name=portfolio&showposts=6&paged=$page&meta_key=$filter&meta_value=$value”);
?>
<?php while (have_posts()) : the_post(); ?>This is working fine for displaying the posts under the default settings but my question is:
Is there any way to update the filter and value in the query posts using a type of sub menu?e.g.
Website
Graphic Design
SEOEach menu item could be clicked on to display only the posts that have that particular filter.
Any help would be appreciated.
regards,
John
Orange Tree Design Studio
- The topic ‘Create menu based on Custom Fields’ is closed to new replies.