WordPress.org

Ready to get started?Download WordPress

Forums

How to delete "published by" (18 posts)

  1. ehquionest
    Member
    Posted 1 year ago #

    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

    http://test.sblanc.com/blog/

  2. RemoteC
    Member
    Posted 1 year ago #

    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 ;-)

  3. ehquionest
    Member
    Posted 1 year ago #

    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 !

  4. Xaliber
    Member
    Posted 1 year ago #

    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.

  5. ehquionest
    Member
    Posted 1 year ago #

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

  6. Xaliber
    Member
    Posted 1 year ago #

    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 .

  7. ehquionest
    Member
    Posted 1 year ago #

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

  8. ehquionest
    Member
    Posted 1 year ago #

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

  9. ehquionest
    Member
    Posted 1 year ago #

  10. Xaliber
    Member
    Posted 1 year ago #

    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.

  11. Digilodger
    Member
    Posted 1 year ago #

    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. :)

  12. Xaliber
    Member
    Posted 1 year ago #

    @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. : /

  13. ehquionest
    Member
    Posted 1 year ago #

    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

  14. ehquionest
    Member
    Posted 1 year ago #

    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

  15. Digilodger
    Member
    Posted 1 year ago #

    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?

  16. ehquionest
    Member
    Posted 1 year ago #

    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 !

  17. Xaliber
    Member
    Posted 1 year ago #

    In your loop.php, under <?php /* How to display all other posts. */ ?>, search for:

    <span class="comments-link"><?php comments_popup_link( __( 'Leave a comment', 'twentyten' ), __( '1 Comment', 'twentyten' ), __( '% Comments', 'twentyten' ) ); ?></span>
    	<?php edit_post_link( __( 'Edit', 'twentyten' ), '<span class="meta-sep">|</span> <span class="edit-link">', '</span>' ); ?>

    Move it to below the
    <?php twentyten_posted_on(); ?>

  18. ehquionest
    Member
    Posted 1 year ago #

    I tried, but everything after "Posted in Russie |" disappeared and wasn't displayed after "Posted on 13 octobre 2012"

Topic Closed

This topic has been closed to new replies.

About this Topic