Community Forums › Forums › Archived Forums › General Discussion › Custom Feature Image Function
- This topic has 4 replies, 2 voices, and was last updated 12 years, 5 months ago by
tristanjud.
-
AuthorPosts
-
August 25, 2013 at 3:16 am #58680
tristanjud
MemberHi,
I've just switched back to Genesis after a bit of hiatus using a theme from Obox. I've purchased the Metro theme as is this the closest to what I was looking for.
The Obox theme I was using had a custom input form element in the "add new post" page called Video Link. I used WordPress's inbuilt oEmbed feature to display a video where the featured image was if there was no feature image present.
This seems fairly easy to code up however I'm struggling to find a hook or filter to customize the feature image function of Genesis. Obviously the Metro theme relies heavily on widgets which I've setup using the instructions provided.
So can someone tell me how to go about customising the functionality of the feature image output?
Thanks,
http://raw.tristanjud.com
TristanAugust 25, 2013 at 5:46 am #58697AnitaC
KeymasterI think (I could be wrong) that you are looking for this. I use it on all of my sites. It renders the thumbnail image of the Youtube video if you haven't used the Featured Image. The thumbnail will not appear until you actually publish the post though.
http://wordpress.org/plugins/featured-video/
Need help with customization or troubleshooting? Reach out to me.
August 25, 2013 at 5:59 am #58702tristanjud
MemberAnitac, pretty cool but not quite what i'm after.
Since I already have 100's of posts that have used the custom form input in my previous theme, i'm looking for away to customise the feature image output function so that i can check to see if this other field is valid or not.
August 25, 2013 at 6:01 am #58703AnitaC
KeymasterOkay, I didn't anticipate 100's! I know Brad Dalton of WPSites.net who posts here on the forum writes a lot of custom code/tutorials. Check out his site to see if he has anything that will work or reach out to him. He might be able to just write you something.
Need help with customization or troubleshooting? Reach out to me.
August 25, 2013 at 7:27 am #58723tristanjud
MemberFor those interested this is where i've got to. It displays the "featured image" or the "oEmbed" video on the single post page.
I haven't been able to get it to work with the front page widgets such as "genesis feature post" widget etc... just yet.
add_action( 'genesis_before_post_content', 'feature_image_video' ); function feature_image_video() { if (get_post_meta(get_the_ID(), 'video_link', true) != '') { $feature_video_link = get_post_meta( get_the_ID(), 'video_link', true ); $embed_code = wp_oembed_get( $feature_video_link, array('width'=>676) ); echo $embed_code; } else { the_post_thumbnail( 'custom_feature_size' ); } } -
AuthorPosts
- The forum ‘General Discussion’ is closed to new topics and replies.