WordPress.org

Support

Support » Themes and Templates » How to delete "published by"

How to delete "published by"

  • Hello,
    I am using Twenty Ten theme on my blog and would like to know how to delete/or not show “Posted by” (“Publié par” on my website cause it’s in French) in bellow the post title. I just want “Posted the (with the date)” but that’s it.
    Thank you for your help !
    Samuel

    Blog

Viewing 15 replies - 1 through 15 (of 17 total)
  • One way described in other threads is to change the concerning CSS classes to ‘display:none;’ (.meta-sep, .author, .vcard) – this can cause some problems on other pages where the class is used but it may work for you.

    The better, but more complicated, solution is to change the function which outputs the author name in the templates functions.php file. This should be twentyten_posted_on() in line 471.

    Make always a child theme when changing one of the default themes (twentyten, twentyeleven)! Else your changes will be lost on the next update.

    PS: Haven’t tested it 😉

    This is what I have in my functions.php file

    function twentyten_posted_on() {
    	printf( __( '<span class="%1$s">Posted on</span> %2$s <span class="meta-sep">by</span> %3$s', 'twentyten' ),
    		'meta-prep meta-prep-author',
    		sprintf( '<a href="%1$s" title="%2$s" rel="bookmark"><span class="entry-date">%3$s</span></a>',
    			get_permalink(),
    			esc_attr( get_the_time() ),
    			get_the_date()
    		),
    		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' ) ),
    			esc_attr( sprintf( __( 'View all posts by %s', 'twentyten' ), get_the_author() ) ),
    			get_the_author()
    		)
    	);
    }

    But I tried to delete differents things, it doesn’t work… Don’t really how and what to delete…
    Thank you !

    Haven’t take a look at Twenty Ten’s functions.php, but I presume that should be replaced with this (I removed unnecessary lines):

    function twentyten_posted_on() {
    	printf( __( '<span class="%1$s">Posted on</span> %2$s', 'twentyten' ),
    		'meta-prep meta-prep-author',
    		sprintf( '<a href="%1$s" title="%2$s" rel="bookmark"><span class="entry-date">%3$s</span></a>',
    			get_permalink(),
    			esc_attr( get_the_time() ),
    			get_the_date()
    		)
    	);
    }

    Might want to test it first though.

    Ok I change my functions.php file
    You can see here http://test.sblanc.com/blog nothing has changed…

    Apparently nothing has changed because the line of codes can’t be read by the browser (since you could see those lines on top of your page)…

    Would you mind posting your entire functions.php and loop.php? You could copy-paste the entire content, each to its own http://pastebin.com .

    Ok, but still didin’t understand how to use this website, once I am login and my code pasted…

    functions.php (as a theme child) http://pastebin.com/ZNCDAf1R

    Pastebin is just some sort of sites where people put their codes for display, and then others could see it (to get it fixed, or checked, etc). It’s like sharing photo, but instead of photo, it’s code. 🙂 I’m not too good with English so my explanations perhaps won’t be too clear, but I hope it’s still understandable…

    Okay, regarding your code…

    It seems there is nothing wrong with the loop.php, but the functions.php seems pretty messed up. Since the tags are converted, thus making it unreadable…

    I’m not too sure, but perhaps it is caused by the text editor you are using. What text editor are you using? I’d suggest you use (if you haven’t) something like Notepad++, if you’re on Windows, so the codes wouldn’t get messed up when you copy-pasted it from the web.

    Anyway, try replacing your function twentyten_posted_on() with this one: http://pastebin.com/ZapJgmye Try to copy from the RAW Paste Data box.

    Hi ehquionest,

    I’m not sure why we’re going around posting codes everywhere. But I’m assuming that the original question hasn’t been answer, right?

    In that case, please enter this into your custom CSS or child-theme CSS; or if you have the latest version of Jetpack, go to Appearance –> Edit CSS:

    .meta-sep, .author { display:none; /* make by author not display */ }

    ^ preferably at the end of the CSS.

    Best regards,
    Digilodger

    P.S. Your site is throwing out some PHP errors. You might want to restore your functions.php to the default. 🙂

    @digilodger:
    Thought of that too. But I’m not sure if it is the best practice, since the content is actually still there; it is only hidden with CSS. : /

    If the content is just hidden it’s perfect in case one day I want to show it again.
    It works but modifiy something at the same time. I have to leave now, come back on that later !
    Thank you !
    Samuel

    Back… So I triedi with
    .meta-sep, .author { display:none; /* make by author not display */ }

    You can see what’s happened here.

    So it’s great as you can see above the picture “par Samuel” is not displayed. But at the same time, bellow the picture, the separator disapeared, how to keep it ?
    Just to let you know I would like too for an other request “Un commentaire” just after “Publié le “.
    Thank you !
    Samuel

    Sorry about that, please remove the previous code and try this instead:

    .entry-meta .meta-sep, .entry-meta .author { display:none; /* make by author not display */ }

    What that code above does is tell the “by author display:none” to only affect the entry-meta class, while leaving everything outside of entry-meta untouch.

    And thanks for the screenshot; that makes things much easier to understand.

    ————

    And I’m not sure what you mean on your next request. Did you mean moving Un commentaire up to where the entry meta is?

    Thank you it works very well, indeed with a screenshot it’s easier to understand. Thank you again, I am learning slowly !
    My second request, is what you can see on this second screenshot http://www.flickr.com/photos/61930185@N02/8096215637/in/photostream

    After the year (“2012″ here), I would like a ” – ” and “x commentaires” and ” ” Edit
    Thanks !

Viewing 15 replies - 1 through 15 (of 17 total)
  • The topic ‘How to delete "published by"’ is closed to new replies.
Skip to toolbar