WordPress.org

Ready to get started?Download WordPress

Forums

full text for sticky posts in custom category.php (2 posts)

  1. catwingz
    Member
    Posted 1 year ago #

    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
    http://dev.blueplanetlaw.com/ferc-bpa-regulatory-advice-and-litigation/

    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() ) :
    		the_content();
    		else:
    		the_excerpt();
    		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 } ?>
  2. catwingz
    Member
    Posted 1 year ago #

    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!

Topic Closed

This topic has been closed to new replies.

About this Topic