WordPress.org

Support

Support » Themes and Templates » Remove "Posted By" and "Post Date"

Remove "Posted By" and "Post Date"

Viewing 15 replies - 1 through 15 (of 17 total)
  • esmi
    Forum Moderator

    @esmi

    Yes. You would need to start editing your theme’s page.php template file. I’d also strongly recommend that you use a child theme for these customisations.

    Thanks i will do that, But how do i remove (What do i remove) as per my other message .

    Thansk

    esmi
    Forum Moderator

    @esmi

    In your child theme’s copy of page.php, remove:

    <?php
                        printf( __( '<span class="%1$s">Posted on</span> %2$s by %3$s', 'responsive' ),'meta-prep meta-prep-author',
    		            sprintf( '<a href="%1$s" title="%2$s" rel="bookmark">%3$s</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' ) ),
    			        sprintf( esc_attr__( 'View all posts by %s', 'responsive' ), get_the_author() ),
    			            get_the_author()
    		                )
    			        );
    		        ?>

    But how would i make the page (/about (and more ) ) use the new theme ?

    Thanks

    esmi
    Forum Moderator

    @esmi

    The amended child’s version of page.php will be used automatically by WordPress. That’s how child themes work.

    But how will the page /about use the template /template-child and how will /blog just use /template

    Also remove comments possible ?

    Thanks

    esmi
    Forum Moderator

    @esmi

    The amended child’s version of page.php will be used automatically by WordPress. That’s how child themes work.

    Sorry you dont get me.

    I want some pages to use the child and some to not use the child. I have got the child at /themes/THEMNAME/child but my about page hasent changed

    esmi
    Forum Moderator

    @esmi

    In that case, you’ll need a second template file in the child theme – a custom page template.

    Sorry, Can you explain more ? I don’t really get it ?

    Thanks i have just removed the idea of child theme and just disable that feature for all posts, Can i do this with comments ? So its less of a blog ? Thanks

    [No bumping. If it’s that urgent, consider hiring someone.]

    krowland08
    Member

    @krowland08

    MeHost,

    I see that you aren’t getting the exact information you need. First off, you need to be a little familiar with PHP to be able to customized one of the page templates.

    The previous poster suggested using a child theme, that is because it is the best practice to do so when modifying template code. That said, when you create a child theme and all that is required for that… then you can modify the page.php code to selectively avoid the meta data or date/author data from the display.

    In other words in the code you will need to test for a certain page number or numbers, then skip around the code you don’t want to show, all other pages would display the same.

    There are examples of doing this in various places around the docs. An alternative is to use an existing theme that already gives you control of this on a page by page basis. It’s a cleaner way to do this, as you don’t need to code a custom template. I can show you one if interested.

    Those are the two ways to do it on your own. Any further help would probably cost you a little consultation fee from a WordPress Ninja programmer, because your asking for a detailed solution to your particular situation, but you’re getting generalized answers because that is all people want to say without having to take more time to research it for you.

    I’ve done this very thing both of these ways. It’s very doable, once you understand where to poke.

    Hope this helps.

    esmi
    Forum Moderator

    @esmi

    In other words in the code you will need to test for a certain page number or numbers, then skip around the code you don’t want to show, all other pages would display the same.

    That really depends upon what changes are needed. If the differences are extensive or another layout is needed, then a complete custom page template would be the way to go.

    @mehost: Please try reading the pages I linked to above. A lot of this will then become understandable.

    krowland08
    Member

    @krowland08

    That really depends upon what changes are needed. If the differences are extensive or another layout is needed, then a complete custom page template would be the way to go.

    Agreed, but it’s clear all he wants is to remove the date and author, which your original solution is correct, not knowing how this would affect design.

    I would normally remove any of the posted by and date from ALL pages, as those are normally just static site informational pages.

    The blog portion can still contain those items. It could be simply done in CSS also, with display:none in the proper places, if you don’t want the author on any pages. Which is usually my situation.

    esmi
    Forum Moderator

    @esmi

    I’m not going to argue semantics with you but, at the moment, the OP hasn’t indicated exactly what he wants in the various Pages.

Viewing 15 replies - 1 through 15 (of 17 total)
  • The topic ‘Remove "Posted By" and "Post Date"’ is closed to new replies.