WordPress.org

Ready to get started?Download WordPress

Forums

Remove "Posted By" and "Post Date" (18 posts)

  1. MeHost
    Member
    Posted 1 year ago #

    Hello,

    I am working on my Word Press site at http://www.mehost.co.uk and on this page http://mehost.co.uk/about/ we have a page on our site. But we don't want "posted by" and "post date" as its a site page. But on http://mehost.co.uk/blog/ (Not made yet) we want it

    Can we do this ?

    Thanks !

  2. esmi
    Theme Diva & Forum Moderator
    Posted 1 year ago #

    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.

  3. MeHost
    Member
    Posted 1 year ago #

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

    Thansk

  4. esmi
    Theme Diva & Forum Moderator
    Posted 1 year ago #

    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()
    		                )
    			        );
    		        ?>
  5. MeHost
    Member
    Posted 1 year ago #

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

    Thanks

  6. esmi
    Theme Diva & Forum Moderator
    Posted 1 year ago #

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

  7. MeHost
    Member
    Posted 1 year ago #

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

    Also remove comments possible ?

    Thanks

  8. esmi
    Theme Diva & Forum Moderator
    Posted 1 year ago #

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

  9. MeHost
    Member
    Posted 1 year ago #

    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

  10. esmi
    Theme Diva & Forum Moderator
    Posted 1 year ago #

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

  11. MeHost
    Member
    Posted 1 year ago #

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

  12. MeHost
    Member
    Posted 1 year ago #

    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.]

  13. krowland08
    Member
    Posted 1 year ago #

    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.

  14. esmi
    Theme Diva & Forum Moderator
    Posted 1 year ago #

    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.

  15. krowland08
    Member
    Posted 1 year ago #

    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.

  16. esmi
    Theme Diva & Forum Moderator
    Posted 1 year ago #

    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.

  17. MeHost
    Member
    Posted 1 year ago #

    Thanks for all your responses (And sorry for bumping) Well i am using WordPress to run my main site as WELL as a blog, So all the pages i dont want "posted by" and the whole idea of comments.

    If you go to http://mehost.co.uk/about/ i have removed the "Posted By" as per the responses above.

    But i need to remove the whole idea of comments, but on one page i want it to be normal.

    Thanks Very Much

  18. esmi
    Theme Diva & Forum Moderator
    Posted 1 year ago #

    Can you elaborate on what you mean by "normal"? Remember that in WordPress Posts (and post listing pages) are very different to Pages.

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.