Removing date and author from posts in Crystal

Community Forums Forums Design Tips and Tricks Removing date and author from posts in Crystal

This topic is: not resolved

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

Viewing 10 posts - 1 through 10 (of 10 total)
  • Author
    Posts
  • #88283

    kathiemt
    Participant
    Post count: 124

    I’m using the Crystal theme and looking for a way to remove the author and date reference on posts. But it’s not working.

    Tried this code at the end of the css which I found in another thread.

    .single-post .post-info .date,
    .single-post .post-info .time {
    display: none;
    }

    But that hasn’t done what I need. Any ideas please?


    Virtual Assistant & Nature Photographer
    Kathie Thomas: VADirectoryClick here for Australian images

    http://www.publicspeaking.com.au/blog/?p=978
    #88292

    nutsandbolts
    Keymaster
    Post count: 3202

    Add this to functions.php:

    //* Remove post info on single posts
    add_action ( 'genesis_post_content' , 'remove_post_info_single' );
    function remove_post_info_single() {
    	global $post;
    	if ( is_single () )
    		remove_action( 'genesis_before_post_content', 'genesis_post_info' );
    }

    That should remove the post info on single posts only.


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

    #88296

    kathiemt
    Participant
    Post count: 124

    Thanks, but that didn’t work. I ended up with this error message:

    Parse error: syntax error, unexpected T_GLOBAL, expecting T_STRING or T_VARIABLE or ‘$’ in /clientdata/www/au/p/publicspeaking.com.au/blog/wp-content/themes/crystal/functions.php on line 140


    Virtual Assistant & Nature Photographer
    Kathie Thomas: VADirectoryClick here for Australian images

    #88297

    nutsandbolts
    Keymaster
    Post count: 3202

    Try taking out the line that says global $post; – that should get it. If not, please paste in the entire functions.php and I’ll take a look.


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

    #88698

    kathiemt
    Participant
    Post count: 124

    That didn’t work at all. I’ve now changed the theme for the client who wanted one that was mobile responsive and tried this code for that theme too (Executive Pro) but it definitely didn’t work and came up with error codes as mentioned above.


    Virtual Assistant & Nature Photographer
    Kathie Thomas: VADirectoryClick here for Australian images

    #88699

    kathiemt
    Participant
    Post count: 124
    This reply has been marked as private.
    #88703

    nutsandbolts
    Keymaster
    Post count: 3202

    This works for Executive Pro – I just used it on a test site:

    //* Remove post info on single posts
    add_action( 'genesis_before_loop', 'nabm_remove_post_info' );
    function nabm_remove_post_info() {
    if( is_single() )
    remove_action( 'genesis_entry_header', 'genesis_post_info', 5 );
    }

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

    #88705

    kathiemt
    Participant
    Post count: 124

    I’m still getting an error.

    Parse error: syntax error, unexpected $end, expecting T_STRING or T_VARIABLE or ‘$’ in /clientdata/www/au/p/publicspeaking.com.au/blog/wp-content/themes/executive-pro/functions.php on line 224


    Virtual Assistant & Nature Photographer
    Kathie Thomas: VADirectoryClick here for Australian images

    #88706

    nutsandbolts
    Keymaster
    Post count: 3202

    I can’t tell where line 224 is – when I paste your functions file above into a text editor, it’s only 221 lines long. But since it doesn’t have code tags the formatting is incorrect.

    Can you download your functions.php and attach it to an email? My email address is andrea@nutsandboltsmedia.com


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

    #88719

    braddalton
    Participant
    Post count: 10681

    Try the 2nd snippet on this page and remove the shortcode for the date and author from the code.

    What you need to do is filter the post info and return the modified value.

    Otherwise you can use the remove action to remove the entire post info however your question related to removing the date and author only.


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

You must be logged in to reply to this topic.