Help Needed: Not to display post info on sticky posts

Discussion in 'WordPress' started by zigzag007, Dec 17, 2010.

  1. #1
    Not to display post info on sticky posts

    Self hosted site.

    http://www.loanmodsource.com

    I have tried the below code.

    .sticky .postinfo {display:none;}

    I put it in the Stylesheet section to no avail.

    The code works on my wordpress.com site.


    Also where to put favicon code?

    Thanks for any help.
    Jeff
     
    zigzag007, Dec 17, 2010 IP
  2. Cash Nebula

    Cash Nebula Peon

    Messages:
    1,197
    Likes Received:
    67
    Best Answers:
    0
    Trophy Points:
    0
    #2
    The Digg 3-column theme does not add post classes, it just has a "post" class which is useless for styling sticky posts.

    Open index.php and goto line 9. Replace the class with a call to post_class():
    
    <div <?php post_class(); ?> id="post-<?php the_ID(); ?>">
    
    Code (markup):
    Or you can add a test for sticky posts to the postinfo sections, without needing to add classes or change the stylesheet.
    
    [COLOR="blue"]<?php if(!is_sticky()) { ?>[/COLOR]
       <div class="postinfo">
       <?php _e('Posted on'); ?> <span class="postdate"><?php the_time('F jS, Y') ?></span> <?php _e('by'); ?> <?php the_author() ?> <?php edit_post_link('Edit', ' &#124; ', ''); ?>
       </div>
    [COLOR="blue"]<?php } ?>[/COLOR]
    
    <div class="entry">
    
    <?php the_content('Read more &raquo;'); ?>
    
    [COLOR="blue"]<?php if(!is_sticky()) { ?>[/COLOR]
       <p class="postinfo">
       <?php _e('Filed under&#58;'); ?> <?php the_category(', ') ?> &#124; <?php comments_popup_link('No Comments &#187;', '1 Comment &#187;', '% Comments &#187;'); ?>
       </p>
    [COLOR="blue"]<?php } ?>[/COLOR]
    
    Code (markup):
     
    Last edited: Dec 17, 2010
    Cash Nebula, Dec 17, 2010 IP