Are you using the Genesis theme in your WordPress website and want to remove the date field from single post page.
There are two options to do this. First is very easy you only to add below code at the end of the functions.php file and you have done!. If this method does not work for you, then create a separate WordPress child theme. I have explained the second method in detail below.
1 2 3 4 5 6 7 8 9 10 11 12 13 |
add_filter( 'genesis_post_info', 'remove_single_post_date' ); function remove_single_post_date( $post_info ) { $single_post_info = 'by [post_author_posts_link] [post_comments] [post_edit]'; $default_post_info = '[post_date] by [post_author_posts_link] [post_comments] [post_edit]'; $post_info = is_singular( 'post' ) ? $single_post_info : $default_post_info; return $post_info; } |
This is the second method to remove the remove the date field from single post page. Create a WordPress child theme of your existing Genesis theme. A few days back, I have written a tutorial “How to create WordPress child theme“. Create single.php file in your child theme folder and copy paste following PHP code.
1 2 3 4 5 6 7 8 |
add_filter( 'genesis_post_info', 'remove_date' ); function remove_date($post_info) { $post_info = 'by [post_author_posts_link] [post_comments] [post_edit]'; return $post_info; } genesis(); |
If you like FreeWebMentor and you would like to contribute, you can write an article and mail your article to [email protected] Your article will appear on the FreeWebMentor main page and help other developers.
Article Tags: best wordpress themes, wordpress tutorial, wordpress tutorial for beginner, wordpress tutorial for beginners, wordpress tutorials, wordpress tutorials for beginners, wordpress tutorils