Community Forums › Forums › General Discussion › Remove Post Meta from home page with excerpts
This topic contains 7 replies, has 3 voices, and was last updated by braddalton 3 months, 1 week ago.
-
AuthorPosts
-
February 10, 2013 at 9:45 pm #19513
I am trying to add a jpg of my disclosure under the post meta on the posts only. When I use simple hooks I can achieve that, however it also shows up on my homepage under my post meta. Is there anyway to remove the post meta from my home page? Or, is there something different you would suggest using to have it appear on my posts only? I am using the Blissful theme.
< a href=”http://amomhavingfun.com”>A Mom Having Fun</a>
Thank you!!
-
This topic was modified 3 months, 1 week ago by
niftycreations.
-
This topic was modified 3 months, 1 week ago by
niftycreations.
February 10, 2013 at 9:57 pm #19519Use following in functions.php
// remove post meta on homepage
remove_action(‘genesis_after_post_content’, ‘genesis_post_meta’);
add_action(‘template_redirect’, ‘child_conditional_actions’);
function child_conditional_actions() {
if( is_single() ) {
add_action(‘genesis_after_post_content’, ‘genesis_post_meta’);
}}
February 10, 2013 at 10:17 pm #19522Hi @idavinder,
I added that code but the post meta is still showing on the homepage. Any other suggestions?
Thank you!
February 10, 2013 at 10:19 pm #19523Ahhhh, I just saw the home.php:
<?php
/** Add home top widget area */
add_action( ‘genesis_before_loop’, ‘blissful_home_top’ );
function blissful_home_top() {
dynamic_sidebar( ‘home-top’ );
}genesis();
I added this code:
/** Remove the post meta function for front page only */
remove_action( ‘genesis_after_post_content’, ‘genesis_post_meta’ );Which did remove the post meta from the home page, but my jpg is still showing on the home page. I want that to show up only on the post pages.
Do you have any other suggestions?
February 10, 2013 at 11:32 pm #19534You can add a widget area to the genesis_after_content area and use the is_single() conditional tag or the Widget Logic plugin so it doesn’t display on any archive pages including the homepage.
Code: http://pastebin.com/u/braddalton
Another way is to hide the image on the homepage using CSS code:
Can you post a link to your site please.
WordPress Developer & Consultant
Brad Dalton @ WP Sites – Click Here to Get Genesis Child Theme Tips Delivered.February 11, 2013 at 3:36 pm #19696Hi @braddalton
The link to my website is: <a href=”http://amomhavingfun.com”>A Mom Having fun</a>
Thank you!
February 11, 2013 at 4:34 pm #19713Yay, I got it to work! Thank you @braddalton, your suggestions definitely helped!
I put:
<?php if (is_single()) { ?>
<img border=”0″ src=”http://amomhavingfun.com/wp-content/uploads/2013/02/disclosure1.jpg” /></a>
<?php } ?>Under the
genesis_post_contentHookThank you again! So excited!
February 12, 2013 at 2:26 am #19782You could also add a widget to that hook easily
WordPress Developer & Consultant
Brad Dalton @ WP Sites – Click Here to Get Genesis Child Theme Tips Delivered. -
This topic was modified 3 months, 1 week ago by
-
AuthorPosts
You must be logged in to reply to this topic.