Support » Fixing WordPress » full text for sticky posts in custom category.php

  • I am working with a framework in which I have modified the archive.php file to make a set of customized category.php files. I am trying to further modify them so that posts designated as sticky will show the full text while the default is set for excerpt. the current page can be seen at

    I have tried placing the code for this after the <h1> as well as where it is in the following code but it’s not getting the job done. Can someone help me sort this out?

    <?php if (have_posts()) : ?>
    	<?php if( is_sticky() ) :
    		endif; ?>
    	<?php $post = $posts[0]; // Hack. Set $post so that the_date() works. ?>
    	<?php /* If this is a category archive */ if (is_category()) { ?>
    	<h1><?php single_cat_title(); ?></h1>
    	<?php /* If this is a tag archive */ } elseif( is_tag() ) { ?>
    	<h2>Posts Tagged ‘<?php single_tag_title(); ?>’</h2>
    	<?php /* If this is a daily archive */ } elseif (is_day()) { ?>
    	<h2>Archive for <?php the_time('F jS, Y'); ?></h2>
    	<?php /* If this is a monthly archive */ } elseif (is_month()) { ?>
    	<h2>Archive for <?php the_time('F, Y'); ?></h2>
    	<?php /* If this is a yearly archive */ } elseif (is_year()) { ?>
    	<h2>Archive for <?php the_time('Y'); ?></h2>
    	<?php /* If this is an author archive */ } elseif (is_author()) { ?>
    	<h2>Author Archive</h2>
    	<?php /* If this is a paged archive */ } elseif (isset($_GET['paged']) && !empty($_GET['paged'])) { ?>
    	<h2>Blog Archives</h2>
    	<?php } ?>
Viewing 1 replies (of 1 total)
  • I have just realized that with the addition of this code the post is now showing up twice on the page, so this is creating a second problem as well as not fixing the first!

Viewing 1 replies (of 1 total)
  • The topic ‘full text for sticky posts in custom category.php’ is closed to new replies.