Forums

Create menu based on Custom Fields (1 post)

  1. infoorangetree
    Member
    Posted 2 years ago #

    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
    SEO

    Each 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

Topic Closed

This topic has been closed to new replies.

About this Topic

  • RSS feed for this topic
  • Started 2 years ago by infoorangetree
  • This topic is not resolved
  • WordPress version: 2.8.4