1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

Removing date from Twenty Ten theme

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

  1. #1
    Anybody know the code and file for removing the date? I tried using a plugin, but somehow it's not removing the date.

    Thanks
     
    bob25, Dec 8, 2010 IP
  2. steers82

    steers82 Peon

    Messages:
    55
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Which date and where?

    Do you mean the dates from the posts? This appears on several files depending on which page you are viewing. Normally, I suppose, you would be looking at the index.php and the post.php pages and removing something like get_the_date
     
    steers82, Dec 8, 2010 IP
  3. club-wp

    club-wp Peon

    Messages:
    30
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Do you mean the "Posted on June 18, 2010" text that appears between the post title and the post text?

    If so, then open the functions.php file in the template folder and type the following:

    return;

    after the line that has the following code (line 441 in my version):

    function twentyten_posted_on() {

    This will remove the posted on text.
     
    club-wp, Dec 8, 2010 IP
  4. steers82

    steers82 Peon

    Messages:
    55
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #4
    I advise strongly against doing this. If you change the functions.php file, then if you ever want to use the date anywhere else in a post/page template, then you will just have to change it back anyway.

    You are better removing the line from the page/post templates and leaving the functions.php file alone.
     
    steers82, Dec 8, 2010 IP
  5. club-wp

    club-wp Peon

    Messages:
    30
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #5
    Yep, this is better than my initial suggestion. Just remove any calls to the twentyten_posted_on() function in the parts of the theme where you don't want it to display.
     
    club-wp, Dec 8, 2010 IP
  6. bob25

    bob25 Active Member

    Messages:
    1,505
    Likes Received:
    12
    Best Answers:
    0
    Trophy Points:
    78
    #6
    Thanks guys. I have it removed from everything but the homepage. I've tried index.php, page.php, single.php, onecolumn-page.php, page.php and removed it from one of them, but can't find the code in any of the rest. Kinda found it in functions.php but it looks really strange to me and I hate to mess with it.

    Anymore ideas? If not I can live with it there, but hate to have to keep updating.

    Thanks
     
    bob25, Dec 8, 2010 IP
  7. club-wp

    club-wp Peon

    Messages:
    30
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #7
    Looks like it appears on lines 65, 115 and 129 in loop.php.
     
    club-wp, Dec 8, 2010 IP
  8. bob25

    bob25 Active Member

    Messages:
    1,505
    Likes Received:
    12
    Best Answers:
    0
    Trophy Points:
    78
    #8
    That did it :)

    Thanks
     
    bob25, Dec 8, 2010 IP
  9. club-wp

    club-wp Peon

    Messages:
    30
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #9
    You're welcome :)
     
    club-wp, Dec 8, 2010 IP