Community Forums › Forums › Archived Forums › Design Tips and Tricks › How to Prevent Automatic Selection of Featured Image?
Tagged: decor, featured image, Studiopress, Wordpress
- This topic has 11 replies, 5 voices, and was last updated 10 years, 1 month ago by scoe.
-
AuthorPosts
-
March 7, 2013 at 10:26 pm #24931scoeMember
Hello Forum,
Any ideas on this?
I would like a featured image to show up if I actually go in and select an image as the featured image. Otherwise I want no featured image to show up, even if I insert images in the body of the post.
I am using the Decor theme. It has featured images in the genesis_before_post_title area by default.
I am starting a new topic. I posted this question previously in an older (slightly related) thread:
http://www.studiopress.community/topic/double-images-on-the-home-page-of-decor/
Thanks for any tips....
SCOE
March 7, 2013 at 10:44 pm #24932delectablychicMemberWhen you are posting, isn't there a place where you can click and upload a featured image?
DelectablyChic!, an online lifestyle publication with a focus on style, dining, travel and more.
March 7, 2013 at 11:11 pm #24937scoeMemberYes, sure and it works great.
The problem comes when I have a post with no featured image.
If I add an icon to the body of that post, when I save that post, that image will show as the featured image even though no featured image is selected. In fact, the featured image area will be blank. The image will show up only when viewing the post on the site.
I can work around this by making sure that all the images I use are previously attached. So I created a dummy draft post called "image upload" and upload all my icons there. That way, whenever I add an icon, it is already attached to another post. Then the automatic feature does not get triggered. Works for me. Don't want to have to tell clients to do that 🙂
Thanks for the reply and encouraging me to clarify.
SCOE
March 8, 2013 at 12:56 am #24947Brad DaltonParticipantThere's a plugin you can install which uses a default featured image if you don't set one. http://wordpress.org/extend/plugins/genesis-featured-images/
March 8, 2013 at 8:01 am #24980scoeMemberThanks so much for responding.
Decor's thing is huge featured images:
http://www.hearthandhome.net/decor/gas/
For balance, I like to break up the top-heavy look by leaving off the featured image for some posts:
http://www.hearthandhome.net/decor/contact/
Setting up the dummy "upload" post is my best work around for now because it only automatically attaches un-attached images.
If this is the first time this is a problem for anyone, maybe I am doing something else wrong? This feature is a bug for me.
/** Add post image above post title */
add_action( ‘genesis_before_post_title’, ‘decor_post_image’ );
function decor_post_image() {
if ( is_page() ) return;
if ( $image = genesis_get_image( ‘format=url&size=post-image’ ) ) {
printf( ‘<a href=”%s” rel=”bookmark” class=”post-photo”><span class=”post-date”>%s</span><img src=”%s” alt=”%s” /></a>’, get_permalink(), do_shortcode( ‘<em>[post_date format="j"]</em>[post_date format="F Y"]‘ ), $image, the_title_attribute( ‘echo=0′ ) );
}
}-- SCOE
March 8, 2013 at 9:59 am #25003scoeMemberHi Brad,
http://www.hearthandhome.net/decor/news/tax-credit-for-2013/
On second thought. Default image at 1x3 transparent gif does the trick nicely.
http://wordpress.org/extend/plugins/default-featured-image/screenshots/
All these urls may break when I go live.
Thanks so much, I still wish I could turn that off... but this will be fine.
SCOE
November 7, 2014 at 10:10 am #130805myersbr2MemberThis is a really old thread but it is the exact trouble I'm having. I don't the post to set a featured image for me if I don't choose one. I just want it to not show up at all unless I select a featured image. Decor randomly chooses an image for me if I don't set a featured image.
The plugin option is one way to go, but I'd really just like to update the functions.php code that controls this:
/** Add post image below post title */
add_action( 'genesis_after_post_title', 'decor_post_image' );
function decor_post_image() {
if ( is_page() ) return;
if ( $image = genesis_get_image( 'format=url&size=post-image' ) ) {
printf( '<span class="post-date">%s</span>', get_permalink(), do_shortcode( '[post_date format="j"][post_date format="F Y"]' ), $image, the_title_attribute( 'echo=0' ) );
} else {
printf( '<div class="post-photo"><span class="post-date">%s</span></div>', do_shortcode( '[post_date format="j"][post_date format="F Y"]' ));
}
}November 7, 2014 at 10:32 am #130808scoeMemberHi myersbr2,
If you have no featured image, long title content pushes up into the "framed corners" at the top and looks ugly. Try using the image above as a default featured image and don't fret.
Thanks Brad for the advice. Still working after all these years.
Also, just a decor-related tip. Since they are not planing a decor pro, we are going to move to the Jessica theme.
http://demo.web-savvy-marketing.com/jessica/
You might like the similar image container sizes.-- Sheryl
November 7, 2014 at 10:52 am #130813myersbr2MemberThanks Sheryl; this solution does work. Good advice. Sometimes I just want to be too much of a purist. 😉
November 7, 2014 at 10:52 am #130814SummerMemberActually, this is a known "quirk" with Genesis, going back a few years and behavior that goes contrary to default WordPress behavior with fallback images, and it wasn't until Genesis 2.0 that a filter was added for people to control this behavior.
See this thread for all the long, technical details: http://www.studiopress.community/topic/no-need-for-featured-image-in-pro-themes/
and yes, I did write that plugin, but it's something I've just been using for myself now and again.
WordPress / Genesis Site Design & Troubleshooting: A Touch of Summer | @SummerWebDesign
Slice of SciFi | Writers, After DarkNovember 7, 2014 at 10:58 am #130816scoeMemberHi myersbr2,
Oh I am the same. I went to all the trouble to do exactly that, change the code, and then I did not like the look. 🙂
-- Sheryl
November 7, 2014 at 10:58 am #130817scoeMemberThanks summer!
-
AuthorPosts
- The forum ‘Design Tips and Tricks’ is closed to new topics and replies.