• Skip to main content
  • Skip to forum navigation

StudioPress

  • Shop for Themes
  • My StudioPress

Forum navigation

  • Home
  • General Genesis Discussions
  • StudioPress Themes
  • Genesis Blocks
    • Genesis Blocks
    • Genesis Custom Blocks
  • Retired Themes
  • FAQs
  • Forum Rules
  • Internationalization and Translations
  • Forum Bugs and Suggestions
  • Forum Log In

Are You Using The WordPress Block Editor?

Genesis now offers plugins that help you build better sites faster with the WordPress block editor (Gutenberg). Try the feature-rich free versions of each plugin for yourself!

Genesis Blocks Genesis Custom Blocks

Custom Feature Image Function

Welcome!

These forums are for general discussion on WordPress and Genesis. Official support for StudioPress themes is offered exclusively at My StudioPress. Responses in this forum are not guaranteed. Please note that this forum will require a new username, separate from the one used for My.StudioPress.

Log In
Register Lost Password

Community Forums › Forums › Archived Forums › General Discussion › Custom Feature Image Function

This topic is: not resolved

Tagged: custom, Metro, php

  • This topic has 4 replies, 2 voices, and was last updated 9 years, 5 months ago by tristanjud.
Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • August 25, 2013 at 3:16 am #58680
    tristanjud
    Member

    Hi,

    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,
    Tristan

    http://raw.tristanjud.com
    August 25, 2013 at 5:46 am #58697
    Anita
    Keymaster

    I 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/


    Love coffee, chocolate and my Bella!

    August 25, 2013 at 5:59 am #58702
    tristanjud
    Member

    Anitac, 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 #58703
    Anita
    Keymaster

    Okay, 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.


    Love coffee, chocolate and my Bella!

    August 25, 2013 at 7:27 am #58723
    tristanjud
    Member

    For 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' );
    	}
    }
  • Author
    Posts
Viewing 5 posts - 1 through 5 (of 5 total)
  • The forum ‘General Discussion’ is closed to new topics and replies.

CTA

Ready to get started? Create a site or shop for themes.

Create a site with WP EngineShop for Themes

Footer

StudioPress

© 2023 WPEngine, Inc.

Products
  • Create a Site with WP Engine
  • Shop for Themes
  • Theme Features
  • Get Started
  • Showcase
Company
  • Brand Assets
  • Terms of Service
  • Accptable Usse Policy
  • Privacy Policy
  • Refund Policy
  • Contact Us
Community
  • Find Developers
  • Forums
  • Facebook Group
  • #GenesisWP
  • Showcase
Resources
  • StudioPress Blog
  • Help & Documentation
  • FAQs
  • Code Snippets
  • Affiliates
Connect
  • StudioPress Live
  • StudioPress FM
  • Facebook
  • Twitter
  • Dribbble