NameSilo

Need urgent help with Wordpress

Spacemail by SpaceshipSpacemail by Spaceship
Watch

nirav.dave

Capsicum MediaworksEstablished Member
Impact
5
I would like to display different number of post in different categories. My current code on category.php is

<?php if ( is_category(array(2,37)) )
{
include(TEMPLATEPATH . '/category1.php');
}
else
{
include(TEMPLATEPATH . '/archive.php');
}
?>


All i want to do is integrate the code below with category1 above, but do not how to do it.

<?php query_posts('category_name=special_cat&showposts=10'); ?>

help highly appreciated.

nirav
 
0
•••
The views expressed on this page by users and staff are their own, not those of NamePros.
AfternicAfternic
Make another category page in the current theme directory and label it category-1.php
Copy the contents of category.php into this file and just before THE LOOP, change the query to what you have above. If this isn't clear, let me know and I will copy the file script for you.

Hope this helps.
 
0
•••
Hey firestorm,

Very kind of you to reply. I tried but it did not work. Below is the code of my category1.php. will appreciate if you can help me on this. Thanks a lot for your time

nirav

<?php get_header(); ?>

<div id="content" class="fullspan">

<div class="container_16 clearfix">

<div id="leftcontent" class="grid_12">

<?php $temp_category = single_cat_title('',false); if (!empty($temp_category)){ // give index ?>
<h1><?php single_cat_title(); ?></h1>

<?php if ($posts) : foreach ($posts as $post) : start_wp(); ?>
<div class="commentfooter"><h2><?php the_time('d M y'); ?> - <a href="<?php the_permalink() ?>"><?php the_title(); ?></a> in <?php the_category(','); ?></h2></div>
<div class="commentbox"><?php the_excerpt() ?></div>
<?php endforeach; else: ?>
<?php the_excerpt() ?>
<p><?php _e('Sorry, no posts matched your criteria.'); ?></p>
<?php endif; ?>
<?php }else{ // give details or single post ?>
...... code for normal post overview
<?php } ?>
<div style="clear:both;height:0px;"></div>

<div id="postnav">
<?php if(function_exists('wp_pagenavi')) { wp_pagenavi(); } ?>
</div><!-- /postnav -->

</div><!-- /leftcontent -->

<?php get_sidebar(); ?>

</div><!-- /container_16 -->

</div><!-- /content -->

<?php get_footer(); ?>



firestorm said:
Make another category page in the current theme directory and label it category-1.php
Copy the contents of category.php into this file and just before THE LOOP, change the query to what you have above. If this isn't clear, let me know and I will copy the file script for you.

Hope this helps.
 
0
•••

We're social

Unstoppable Domains
Domain Recover
DomainEasy — Live Options
  • The sidebar remains visible by scrolling at a speed relative to the page’s height.
Back