Remove Author Name and Comments from Home page

Community Forums Forums Design Tips and Tricks Remove Author Name and Comments from Home page

This topic is: not resolved

This topic contains 6 replies, has 3 voices, and was last updated by  braddalton 9 months ago.

Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • #78740

    L00koutM0re
    Participant
    Post count: 36

    Hi, i am using News Pro Theme and want to remove Author and Comments (meta info) from home page only. I used the following code as shared by Brad, it worked awesome but it also removed the date from the home page. I want to keep the Date as it is.

    Do i need another code or some alteration in the following?

    .home .entry-meta {
    display: none;
    }

    http://www.moremag.pk
    #78748

    nutsandbolts
    Moderator
    Post count: 3130

    You can remove the author and comment links on the homepage by adding a function like this to functions.php:

    add_filter( 'genesis_post_info', 'remove_post_info_home' );
    function remove_post_info_home($post_info) {
    if ( is_home() ) { 
    	$post_info = 'Posted on [post_date] [post_edit]';
    	return $post_info;
    }
       }

    Andrea Whitmer, Owner, Nuts and Bolts Media
    I provide dev and training services for web designers • Find me on Twitter and Google+

    #78752

    braddalton
    Participant
    Post count: 9737

    You’ll need to use PHP code for that. http://wpsites.net/web-design/modify-post-info-genesis/


    Specializing In StudioPress Child Theme Customization.
    500+ StudioPress Tutorials

    #78840

    L00koutM0re
    Participant
    Post count: 36

    Thanks Brad i used your solution and it worked. I found following code to remove author and comment info from home

    .home .entry-comments-link ,
    .home .entry-author{
    display: none;
    }

    #80144

    L00koutM0re
    Participant
    Post count: 36

    Nutsandbolts your code in function.php removes the Author name and comment link from the home page but also it removes them and the date link from the single post as well. How can we keep that information visible on the single post under the title?

    Brad your code worked but i have noticed that it has not removed the word “BY” under the title on home page. Can we remove with the same code?

    #80403

    braddalton
    Participant
    Post count: 9737

    Yes i know which is why you need to use the PHP code embedded on the post i linked to.

    You’ll need to use PHP code for that. http://wpsites.net/web-design/modify-post-info-genesis/


    Specializing In StudioPress Child Theme Customization.
    500+ StudioPress Tutorials

    #80404

    braddalton
    Participant
    Post count: 9737

    I wrote this code for you and tested it so i know it does exactly what you need http://wpsites.net/web-design/remove-author-name-comments-link-in-post-info-on-home-page-only/

    Looks like you have it worked out anyways?


    Specializing In StudioPress Child Theme Customization.
    500+ StudioPress Tutorials

Viewing 7 posts - 1 through 7 (of 7 total)

You must be logged in to reply to this topic.