Community Forums › Forums › Archived Forums › Design Tips and Tricks › Removing date and author from posts in Crystal
Tagged: Author, Cyrstal theme, remove date
- This topic has 9 replies, 3 voices, and was last updated 11 years ago by
Brad Dalton.
-
AuthorPosts
-
February 2, 2014 at 11:05 pm #88283
kathiemt
ParticipantI'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?
Kathie Thomas
February 3, 2014 at 12:25 am #88292nutsandbolts
MemberAdd 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/Developer, Nuts and Bolts Media
I provide development and training services for designers • Find me on Twitter and Google+February 3, 2014 at 1:18 am #88296kathiemt
ParticipantThanks, 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
Kathie Thomas
February 3, 2014 at 1:22 am #88297nutsandbolts
MemberTry 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/Developer, Nuts and Bolts Media
I provide development and training services for designers • Find me on Twitter and Google+February 4, 2014 at 10:03 pm #88698kathiemt
ParticipantThat 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.
Kathie Thomas
February 4, 2014 at 10:04 pm #88699kathiemt
ParticipantThis reply has been marked as private.February 4, 2014 at 10:25 pm #88703nutsandbolts
MemberThis 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/Developer, Nuts and Bolts Media
I provide development and training services for designers • Find me on Twitter and Google+February 4, 2014 at 11:15 pm #88705kathiemt
ParticipantI'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
Kathie Thomas
February 4, 2014 at 11:17 pm #88706nutsandbolts
MemberI 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 [email protected]
Andrea Whitmer, Owner/Developer, Nuts and Bolts Media
I provide development and training services for designers • Find me on Twitter and Google+February 5, 2014 at 1:38 am #88719Brad Dalton
ParticipantTry 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.
-
AuthorPosts
- The forum ‘Design Tips and Tricks’ is closed to new topics and replies.