Community Forums › Forums › Archived Forums › General Discussion › Remove Post Meta from Home Page
Tagged: is_front_page, is_home, meta, post meta
- This topic has 13 replies, 7 voices, and was last updated 11 years ago by Anita.
-
AuthorPosts
-
January 13, 2013 at 3:16 pm #11643ezinesParticipant
How can I remove the post meta on the home page only?
Using Pretty Pictures theme.
January 13, 2013 at 7:54 pm #11717itsonlybarneyMemberI'm not familiar with Pretty Pictures, but I think if you add this code to home.php then it will be removed.
/** Remove the post meta function for front page only */
remove_action( 'genesis_after_post_content', 'genesis_post_meta' );
January 13, 2013 at 9:52 pm #11741ezinesParticipantAppreciate the input but that's not it.
Your snippet "should" remove post meta across the whole site, but for some reason it doesn't work on Pretty Pictures. Not sure why it doesn't work on this theme.
I want to remove post meta from the homepage only.
January 13, 2013 at 10:13 pm #11746itsonlybarneyMemberI mentioned to add it to home.php. Like I said I'm not familiar with Pretty Pictures, and I don't have access to the them.
Also, maybe try adding the plugin - http://wordpress.org/extend/plugins/genesis-visual-hook-guide/ - to see which hook the post meta is added to.
January 15, 2013 at 9:52 pm #12197ezinesParticipantThanks Barney.
No home.php in this theme
Does anyone have a clue?
January 17, 2013 at 10:33 am #12634FireSamuraiMemberEzines,
You'll want to add a function with a conditional statement in your functions.php file, like this:
/** Remove the post meta function on homepage */
function my_remove_post_meta() {
if ( is_home() || is_front_page() ) {
remove_action( 'genesis_after_post_content', 'genesis_post_meta' );
}}January 18, 2013 at 10:45 am #12875ezinesParticipantThanks FireSamurai, but that did not work.
None of the remove post meta functions seem work on this theme.
This is from the SP code snippets page and it also does not work. Meta remains across the theme:
/** Remove the post meta function */
remove_action( 'genesis_after_post_content', 'genesis_post_meta' );I've also tried a variety of things all over the Simple Hooks plugin.
I sincerely thank to community for offering assistance.
It's getting to be WAY PAST TIME for some help from Studiopress support. Is anyone out there?
January 18, 2013 at 10:55 am #12877SusanModeratorIt’s getting to be WAY PAST TIME for some help from Studiopress support. Is anyone out there?
This support forum is for users such as yourself to assist other users. "Official" StudioPress support is for getting the theme to look like the demo, and for technical assistance, and is done by submitting a help ticket. Anything beyond that is deemed "customization" and is handled here on the forum.
Edited to add - I'm a StudioPress user like you, not a StudioPress employee.
January 18, 2013 at 11:10 am #12880SusanModeratorTry this:
January 18, 2013 at 1:30 pm #12905ezinesParticipantFireSamurai - Thanks again!
I kept playing with your code. It was very close, just missing a couple of exclamation marks:
function my_remove_post_meta() {
if ( !is_home() || !is_front_page() ) {
remove_action( 'genesis_after_post_content', 'genesis_post_meta' );
}}January 18, 2013 at 1:57 pm #12913January 28, 2013 at 4:05 pm #15732cdilsParticipantHey there,
Just seeing this thread and wanted to post a complete code snippet to remove the post meta on the home page only of a site. Thanks to @Susan for the starter gist and @ezines for the pointing out the correct action:
add_action( 'genesis_before', 'child_conditional_actions' );
function child_conditional_actions() {if( is_home() || is_front_page() ) { //if page is home page or front page
remove_action( 'genesis_after_post_content', 'genesis_post_meta' );
}}
Have you been helped in this forum? Pay it forward and answer someone else’s question. I bet you’ll know the answer to at least one question. 🙂
I host a weekly WordPress-focused podcast called Office Hours. I tweet @cdils.
February 28, 2013 at 12:28 pm #23317Brad DaltonParticipantMarch 3, 2013 at 7:47 pm #23971AnitaKeymasterBrad, if you didn't change the apostrophes - try copying this. I fixed them.
add_action( ‘genesis_before’, ‘child_conditional_actions’ ); function child_conditional_actions() { if( is_home() || is_front_page() ) { //if page is home page or front page remove_action( ‘genesis_after_post_content’, ‘genesis_post_meta’ ); } }
Love coffee, chocolate and my Bella!
-
AuthorPosts
- The forum ‘General Discussion’ is closed to new topics and replies.