Removing date from Twenty Ten theme sticky?

Discussion in 'WordPress' started by bob25, Dec 30, 2010.

  1. #1
    Anybody know how to do this? I think I got it all except for the sticky. I've tried a date exclusion plugin, but it didn't work.

    The only thing I can see that's left is trying to remove it from functions.php, but that looks like Greek to me :confused:

    Any suggestions?

    Thanks
     
    bob25, Dec 30, 2010 IP
  2. Yuuko008

    Yuuko008 Member

    Messages:
    682
    Likes Received:
    11
    Best Answers:
    0
    Trophy Points:
    33
    #2
    Try this on your index.php.

    Take note this is just pseudocode

    if (sticky()) {
    do not put the function that's calling the date
    }

    else
    {
    put the function that's calling the date
    }

    This is just a tip :)
     
    Yuuko008, Dec 30, 2010 IP
  3. bob25

    bob25 Well-Known Member

    Messages:
    1,519
    Likes Received:
    12
    Best Answers:
    0
    Trophy Points:
    128
    #3
    No that didn't work, or maybe I just did wrong. :(

    Thanks
     
    bob25, Dec 30, 2010 IP
  4. Yuuko008

    Yuuko008 Member

    Messages:
    682
    Likes Received:
    11
    Best Answers:
    0
    Trophy Points:
    33
    #4
    Yuuko008, Dec 30, 2010 IP
  5. KimiGermany

    KimiGermany Peon

    Messages:
    1,117
    Likes Received:
    15
    Best Answers:
    0
    Trophy Points:
    0
    #5
    I only know to hide them via css.

    If you want to hide the date only, try this:
    .sticky span.meta-prep-author,.sticky span.entry-date{display:none;}
    Code (markup):
    If you want to hide all the meta info:
    .sticky .entry-meta{display:none;}
    Code (markup):
    Add those codes right in the very bottom of your css file (style.css)

    However don't forget to make a copy of twenty ten, incase it is updated from wordpress.org, you still have your customisation.
     
    KimiGermany, Dec 31, 2010 IP
  6. Cash Nebula

    Cash Nebula Peon

    Messages:
    1,197
    Likes Received:
    67
    Best Answers:
    0
    Trophy Points:
    0
    #6
    Or you can remove it completely by adding a new function that just shows author information.

    Add this to the end of the functions.php file:
    
    if ( ! function_exists( 'twentyten_posted_by' ) ) :
    /**
     * Prints HTML with author information for the current post
     */
    function twentyten_posted_by() {
    	printf( __( '<span class="%1$s">Posted by</span> %2$s', 'twentyten' ),
    		'meta-prep meta-prep-author',
    		sprintf( '<span class="author vcard"><a class="url fn n" href="%1$s" title="%2$s">%3$s</a></span>',
    			get_author_posts_url( get_the_author_meta( 'ID' ) ),
    			sprintf( esc_attr__( 'View all posts by %s', 'twentyten' ), get_the_author() ),
    			get_the_author()
    		)
    	);
    }
    endif;
    
    Code (markup):
    Then change line 128 in loop.php file to this:
    
    <?php if (is_sticky()) : twentyten_posted_by(); else : twentyten_posted_on(); endif; ?>
    
    Code (markup):
     
    Cash Nebula, Dec 31, 2010 IP
  7. bob25

    bob25 Well-Known Member

    Messages:
    1,519
    Likes Received:
    12
    Best Answers:
    0
    Trophy Points:
    128
    #7
    What no video :)

    That's got it Thanks.
     
    bob25, Dec 31, 2010 IP
  8. bob25

    bob25 Well-Known Member

    Messages:
    1,519
    Likes Received:
    12
    Best Answers:
    0
    Trophy Points:
    128
    #8
    Was going to try this, but counting to 128 I'd probably mess it up :)

    Thanks
     
    bob25, Dec 31, 2010 IP
  9. KimiGermany

    KimiGermany Peon

    Messages:
    1,117
    Likes Received:
    15
    Best Answers:
    0
    Trophy Points:
    0
    #9
    LOL There is a video :)

    But if it helps without, then we don't need it :)

    Most welcome, happy 2011!
     
    KimiGermany, Jan 1, 2011 IP
  10. Cash Nebula

    Cash Nebula Peon

    Messages:
    1,197
    Likes Received:
    67
    Best Answers:
    0
    Trophy Points:
    0
    #10
    For your sake, I hope you're joking! :D

    But in case you're not, it's time to ditch Windows notepad and get a proper editor that has line numbering, like Notepad++
     
    Cash Nebula, Jan 2, 2011 IP
  11. ilook

    ilook Well-Known Member

    Messages:
    1,602
    Likes Received:
    15
    Best Answers:
    1
    Trophy Points:
    165
    #11
    That did not worked at all...
     
    ilook, Nov 13, 2011 IP