WordPress.org

Ready to get started?Download WordPress

Forums

removing automatic sticky post from theme (2 posts)

  1. esterne
    Member
    Posted 4 years ago #

    I'm using Portfolio Press and it automatically keeps the latest post entry 'sticky' and at the top of all pages. My posts are too long for this and I want to remove the code. Just not sure which code controls this.


    http://emilysterne.com/wpblog/

    any help out there? Thanks!

  2. MichaelH
    Member
    Posted 4 years ago #

    With the help of the Template Hierarchy article, determine what Template is displaying your posts (could be index.php). Then edit that Template and delete the code that displays that post.

    The code will look like:

    <?php $my_query = new WP_Query('showposts=1');
            while ($my_query->have_posts()) : $my_query->the_post();
            $do_not_duplicate = $post->ID; ?>
    
            <div class="post new" id="post-<?php the_ID(); ?>">
    
            <h2><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title(); ?>"><?php the_title(); ?></a></h2>
            <div class="info"><div class="comments"><?php comments_popup_link('0 Comments', '1 Comment', '% Comments'); ?> | This entry was posted on <?php the_time('M d Y'); ?> <?php edit_post_link('Edit', ' | ', ''); ?>  </div></div>
    
            <div class="content"><?php the_content('Read more &raquo;'); ?></div>
    
            <div class="meta">
            <div class="tags"><?php the_tags('', ', ', '<br />'); ?></div>
            <div class="cats"><?php the_category(', ') ?></div>
            </div><!--meta-->
    
            </div><!--post-->
            <?php endwhile; ?>

Topic Closed

This topic has been closed to new replies.

About this Topic