Community Forums › Forums › Archived Forums › General Discussion › Remove Post Meta from home page with excerpts
- This topic has 7 replies, 3 voices, and was last updated 13 years, 5 months ago by
Brad Dalton.
-
AuthorPosts
-
February 10, 2013 at 9:45 pm #19513
niftycreations
MemberI 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!!
February 10, 2013 at 9:57 pm #19519Davinder Singh Kainth
MemberUse 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');
}}
Sunshine PRO genesis theme
Need Genesis help? Davinder @ iGuiding Media | My Blog | Fresh Genesis ThemesFebruary 10, 2013 at 10:17 pm #19522niftycreations
MemberHi @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 #19523niftycreations
MemberAhhhh, 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 #19534Brad Dalton
ParticipantYou 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.
February 11, 2013 at 3:36 pm #19696niftycreations
MemberHi @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 #19713niftycreations
MemberYay, 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 #19782Brad Dalton
Participant -
AuthorPosts
- The forum ‘General Discussion’ is closed to new topics and replies.