• Hi Guyz,

    Please help me i’m stuck with this for 2 days now. I’m not an expert on wordpress. I have this home page that has a recent portfolio post slider. I need to call a category on this posts. Please Help!

    ——————————————-

    <?php $paged = (get_query_var('paged')) ? get_query_var('paged') : 1;
    				$args = array(
    				'post_type'=>'portfolio_post_type',
    				'order'=>"DESC",
    				"paged"=>$paged,
    				"posts_per_page"=>get_option('theme_projects_number')
    				);
    				query_posts($args);	?>
    
    				<?php $counter=1; ?>
    				<div class="flexslider flexsliderCarousel">
    				  <ul class="slides">
    			<?php while (have_posts()) : the_post();?>
    				<?php $counter++; ?>
    
    <li>
    			<div class="span3 singleImg">
    				<?php $meta_values = get_post_meta($post->ID, '_media_type', TRUE);
    						if ($meta_values == 'image') { ?>
    							<div class="imgWhite imageOneFourth">
    								<?php $feat_image = wp_get_attachment_url(get_post_thumbnail_id($post -> ID));?>
    								<?php
    								if (has_post_thumbnail()) {
    									the_post_thumbnail('portfolio-four-thumb');
    								} else {
    									echo "";
    								}?>
    							</div>

    ———————————————–

Viewing 1 replies (of 1 total)
  • You will need to add an argument to the $args array. If you know the slug (NOT name) of the category, this should work:

    $args = array(
       'category_name' => 'category-slug',
       'post_type'=>'portfolio_post_type',
       'order'=>"DESC",
       "paged"=>$paged,
       "posts_per_page"=>get_option('theme_projects_number')
    );

    Replace ‘category-slug’ with the slug of your category. The slug can be found by going to Dashboard->Posts->Categories and finding the category you need.

Viewing 1 replies (of 1 total)
  • The topic ‘Need to call Category – Please Help’ is closed to new replies.