• Resolved dsiguy

    (@dsiguy)


    Hi – Thanks in advance for any support.

    The following snippet of code is pulled from the Page’s .php file. The page displays a lightbox gallery 3 wide of posts from a type called “Portfolio.” Within this type, there are various categories, one of them being “sold.” I’m interested in making this particular gallery display only items classified as sold, but confess I can’t figure where/how to edit the following code to reflect that. Thank you again.

    backticks
    <div id=”content” class=”grid_12″>
    <?php include_once (TEMPLATEPATH . ‘/title.php’);?>
    <?php global $more; $more = 0;?>
    <?php $values = get_post_custom_values(“category-include”); $cat=$values[0]; ?>
    <?php $catinclude = ‘portfolio_category=’. $cat ;?>

    <?php $temp = $wp_query;
    $wp_query= null;
    $wp_query = new WP_Query(); ?>
    <?php $wp_query->query(“post_type=portfolio&”. $catinclude .”&paged=”.$paged.’&showposts=9′); ?>
    <?php if ( ! have_posts() ) : ?>
    backticks

Viewing 3 replies - 1 through 3 (of 3 total)
  • Thread Starter dsiguy

    (@dsiguy)

    <div id="content" class="grid_12">
    <?php include_once (TEMPLATEPATH . '/title.php');?>
    <?php global $more;	$more = 0;?>
    <?php $values = get_post_custom_values("category-include"); $cat=$values[0]; ?>
    <?php $catinclude = 'portfolio_category='. $cat ;?>
    
    <?php $temp = $wp_query;
    $wp_query= null;
    $wp_query = new WP_Query(); ?>
    <?php $wp_query->query("post_type=portfolio&". $catinclude ."&paged=".$paged.'&showposts=9'); ?>
    <?php if ( ! have_posts() ) : ?>
    Thread Starter dsiguy

    (@dsiguy)

    Wow I won’t know for sure until I test it more but I may have licked it already! Does anyone see an issue with my edits code below?

    <div id="content" class="grid_12">
    <?php include_once (TEMPLATEPATH . '/title.php');?>
    <?php global $more;	$more = 0;?>
    <?php $values = get_post_custom_values("category-include"); $cat=$values[0]; ?>
    <?php $catinclude = 'portfolio_category='. $cat='sold' ;?>
    
    <?php $temp = $wp_query;
    $wp_query= null;
    $wp_query = new WP_Query(); ?>
    <?php $wp_query->query("post_type=portfolio&". $catinclude ."&paged=".$paged.'&showposts=9'); ?>
    <?php if ( ! have_posts() ) : ?>
    Thread Starter dsiguy

    (@dsiguy)

    Sorry for all the posts:

    Last question. In the same original block of code, how might I go about excluding one particular category type. I’d like a separate page that lists all categories except ‘sold’

    I’m stumped so far.

    Thanks!

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘Limit Gallery to One Post Type’ is closed to new replies.