Forum Replies Created

Viewing 5 replies - 1 through 5 (of 5 total)
  • Thread Starter aghahamidgol

    (@aghahamidgol)

    right , my main category is portfolio with id 4 and i need to make query just for this category, and those number are id of sub-category.
    shall i change the number of sub-category to name or something else :(?
    now class change to “portfolio” the main cat it means it works but how to manage them using with sub-cat?

    Thread Starter aghahamidgol

    (@aghahamidgol)

    in output class is empty 🙁 it doesn’t work 🙁

    <?php if(is_category('5')) { $class='web'; }
    			 if(is_category('7')) { $class='video'; }
    			if(is_category('8')) { $class='graphic'; }
    			if(is_category('6')) { $class='photo'; }
    			if(is_category('9')) { $class='commerce'; }
    			if(is_category('10')) { $class='coding'; }
    	  ?>
    	<li data-id="id-1" class="<?php echo $class; ?>">

    this is all the code for loop

    <!-- Begin loop porfolio -->
    <?php query_posts('cat=4'); ?>
    <?php if (have_posts()) : while (have_posts()) : the_post(); ?>
    
    		  <?php if(is_category('5')) { $class='web'; }
    			 if(is_category('7')) { $class='video'; }
    			if(is_category('8')) { $class='graphic'; }
    			if(is_category('6')) { $class='photo'; }
    			if(is_category('9')) { $class='commerce'; }
    			if(is_category('10')) { $class='coding'; }
    	  ?>
    	<li data-id="id-1" class="<?php echo $class; ?>">
            <span class="boxgrid caption">
            	<!-- Begin Full Size Link and Description -->
    			<a href="<?php bloginfo('stylesheet_directory') ?>/style/images/1.jpg" class="colorbox" title="<?php the_title(); ?>">
    				<img src="<?php bloginfo('stylesheet_directory') ?>/style/images/th1.jpg"/><!-- Image Thumnail -->
    			</a>
            	<!-- End Full Size Link and Description -->
            	<!-- Begin Caption -->
            	<span class="cover boxcaption">
          			<strong><?php the_title(); ?></strong>
            		<em><a href="<?php the_permalink(); ?>">Click here to visit the details.</a></em>
            	</span><!-- End Caption -->
            </span>
         </li>
    
    <?php endwhile; else: ?>
    <p>error</p>
    <?php endif; ?>
    
    <!-- End loop porfolio -->
    Thread Starter aghahamidgol

    (@aghahamidgol)

    tnx a lot i am trying now

    Thread Starter aghahamidgol

    (@aghahamidgol)

    thank you keesiemeijer, but i have 5 class i have to write else if for them or switch case?
    how to manage them? i have 5 different category for post

    Thread Starter aghahamidgol

    (@aghahamidgol)

    i used my defualt application on my server and then i upgrade wordpress to 2.7 … and is workin fine !

    tnx a lot samboll and figaro …

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