Community Forums › Forums › Archived Forums › Design Tips and Tricks › Featured Video in Teasers
Tagged: featured videos
- This topic has 21 replies, 5 voices, and was last updated 8 years, 4 months ago by Brad Dalton.
-
AuthorPosts
-
April 17, 2016 at 6:46 am #183771NicolettaMember
Hi, I'm currently building my blog with the Metro Pro Theme.
On the home page I use teasers of my articles with featured images. But on selected articles I'd like to show a featured video instead of a featured image in the teaser. Is there a way (plug-in, code) to achieve that?
I found the "Featured Video Plus plugin" but that doesn't appear to be working with Genesis themes.
https://ziprett.ch/April 17, 2016 at 6:48 am #183772Brad DaltonParticipantI would ask plugin support why it doesn't work with Genesis https://wordpress.org/support/plugin/featured-video-plus
April 17, 2016 at 7:07 am #183773NicolettaMemberThanks a lot for the fast answer and for already asking the plugin support!
I just read on the plugin support page that apparently there's a problem with WordPress 4.5, so it's also possible that that's the problem and not Genesis.
April 18, 2016 at 10:29 am #183840Brad DaltonParticipantJust tested it and it works in Genesis running WordPress 4.5 and also tested on development version (4.6-alpha-37231).
Make sure you have enable featured images in Genesis > Theme Settings > Content Archives.
April 19, 2016 at 1:51 am #183886alwibMemberi have some problem on my web teknik budidaya, but recently solved
thanks you
April 24, 2016 at 7:52 am #184319NicolettaMemberDid you test it with the Metro Pro Theme?
I have featured images in content archives und for teaser posts enabled but I can't get the plugin to run. Guess I have to keep trying or find another solution.
May 16, 2016 at 11:23 am #185714davidzackMemberI'm having a similar issue. It looks like what should happen is, if you add a featured video, the featured image should automatically populate with a thumbnail from the video.
I'd actually like to use the video itself in the loop instead of an image. So rather than trying to get this feature to work, is it possible to have the loop replace the image with the video if a video exists?
May 17, 2016 at 2:19 am #185751Brad DaltonParticipantMay 21, 2016 at 5:01 pm #186038NicolettaMember@davidzack: I think we are searching for the same thing.
I have an idea for some kind of a workaround but haven't gotten to get it to work yet. I have activated the post types in genesis and now want to change the genesis loop on the front page so that only posts with the type "video" are shown as full posts and "standard" post types are shown with an excerpt. This would allow my visitors to watch the videos directly on the front page. But this of course only works because my video posts have hardly any text anyway. Maybe this gives you some ideas :).
June 15, 2016 at 5:41 pm #187610jdaviescoatesMemberI also have this issue. Featured Video Plus used to work fine with Genesis + Magazine Pro, but obviously some update to either WordPress and/or Genesis has broken it (although saying that, some people had these incompatibility issues years ago see e.g. https://wordpress.org/support/topic/video-only-displaying-as-screenshot although I had it working fine long after that).
It now no longer replaces the featured image with a video, but just a thumbnail of the video.
I'd love to get it working again so that videos are actually displayed where the featured images are normally displayed.
Any ideas? I'm guessing adding some of their functions to functions.php would do the trick (as per https://wordpress.org/support/topic/video-only-displaying-as-screenshot#post-3606396 but I'm not exactly sure how best to do that).
At present I have this code in my functions.php
//* Add featured images after title on single posts and pages add_action( 'genesis_entry_header', 'single_post_featured_image', 15 ); function single_post_featured_image() { if ( ! is_singular() ) return; $img = genesis_get_image( array( 'format' => 'html', 'size' => genesis_get_option( 'image_size' ), 'attr' => array( 'class' => 'post-image' ) ) ); printf( '<a href="%s" title="%s">%s</a>', get_permalink(), the_title_attribute( 'echo=0' ), $img ); }
I guess somehow I need to add something like (as per https://wordpress.org/support/topic/video-only-displaying-as-screenshot#post-3606396 ):
if ( has_post_video() ) { the_post_video(); } elseif ( has_post_thumbnail() ) { echo post_thumbnail; }
Could someone help me do that?
June 15, 2016 at 5:55 pm #187612jdaviescoatesMemberI see this in an on-going issue:
I even have been in contact with the Genesis Framework guys in order to try to enable automatic integration with their themes – sadly I haven’t been able to resolve it.
:
I think this is perhaps the first time I'm a bit annoyed that I'm using Genesis 🙁
Why does Genesis not implement standard WordPress Featured Image stuff so things like this just work?
June 15, 2016 at 6:00 pm #187613jdaviescoatesMemberSee also this github thread:
https://github.com/ahoereth/featured-video-plus/issues/5
I tried some of the code there and it almost got me to where I wanted, but not quite :-/
June 15, 2016 at 6:00 pm #187614Brad DaltonParticipantThis question relates to a 3rd party plugin which no longer seems to work. I suggest you look for another plugin which does work.
Otherwise, you'll need custom code written.
June 15, 2016 at 6:11 pm #187616Brad DaltonParticipantThis works when i test it
add_filter( 'genesis_pre_get_image', 'featured_video_plus_genesis_override', 10, 2 ); function featured_video_plus_genesis_override( $output, $args ){ // only act on archive featured images if( $args['context'] == 'archive' && function_exists('has_post_video') && has_post_video() ) { return the_post_video(); } else { return $output; } }
June 15, 2016 at 6:23 pm #187618jdaviescoatesMemberHeh, it seems I had this problem before:
I've not got it pretty much working as intended.
I'd previously added this to get featured images to display on single post and pages:
//* Add featured images after title on single posts and pages add_action( 'genesis_entry_header', 'single_post_featured_image', 15 ); function single_post_featured_image() { if ( ! is_singular() ) return; $img = genesis_get_image( array( 'format' => 'html', 'size' => genesis_get_option( 'image_size' ), 'attr' => array( 'class' => 'post-image' ) ) ); printf( '<a href="%s" title="%s">%s</a>', get_permalink(), the_title_attribute( 'echo=0' ), $img ); }
I've now removed that and replaced it with this:
/* Code to Display Featured Image (and therefore featured video embed) on archive posts add_action( 'genesis_before_entry_content', 'featured_post_image', 8 ); function featured_post_image() { if ( is_singular( 'archive' ) ) return; the_post_thumbnail('post-image'); }
And have unchecked "Include the Featured Image?" in Genesis -> Theme Options
Now I've got the featured video being displayed instead of the featured image on single posts:
And in archives:
http://open.coop/category/open/But not on the homepage:
Be great to get it working there too...
June 15, 2016 at 6:28 pm #187619jdaviescoatesMemberGah, I've just posted another long comment here (twice) and I'm not getting any moderation warnings, but it isn't appearing and when I tried to re-post it after writing it the second time it said I'd already said that...
June 15, 2016 at 6:29 pm #187620jdaviescoatesMemberRe-trying long post without links:
Heh, it seems I had this problem before:
I've now got it pretty much working as intended.
I'd previously added this to get featured images to display on single post and pages:
//* Add featured images after title on single posts and pages add_action( 'genesis_entry_header', 'single_post_featured_image', 15 ); function single_post_featured_image() { if ( ! is_singular() ) return; $img = genesis_get_image( array( 'format' => 'html', 'size' => genesis_get_option( 'image_size' ), 'attr' => array( 'class' => 'post-image' ) ) ); printf( '<a href="%s" title="%s">%s</a>', get_permalink(), the_title_attribute( 'echo=0' ), $img ); }
I've now removed that and replaced it with this:
/* Code to Display Featured Image (and therefore featured video embed) on archive posts add_action( 'genesis_before_entry_content', 'featured_post_image', 8 ); function featured_post_image() { if ( is_singular( 'archive' ) ) return; the_post_thumbnail('post-image'); }
And have unchecked "Include the Featured Image?" in Genesis -> Theme Options
Now I've got the featured video being displayed instead of the featured image on single posts:
[link removed in hope comment will post]And in archives:
[link removed in hope comment will post]But not on the homepage:
[link removed in hope comment will post]Be great to get it working there too...
June 15, 2016 at 6:33 pm #187622jdaviescoatesMemberBrad,
re:
This question relates to a 3rd party plugin which no longer seems to work. I suggest you look for another plugin which does work.
The plugin works really well, it just doesn't play well with Genesis child themes (although it has previously worked fine with them too).
But many thanks for your code suggestion, I give that a whirl too to see what results it produces...
June 15, 2016 at 6:40 pm #187623jdaviescoatesMemberBrad,
Your code added the featured image to archive pages (when featured image option checkbox was selected in Genesis -> Theme Settings), but not on single posts, and even in the archives it was too small.
For now I've just gone back to using this code:
//* Code to Display Featured Image (and therefore featured video embed) on archive posts add_action( 'genesis_before_entry_content', 'featured_post_image', 8 ); function featured_post_image() { if ( is_singular( 'archive' ) ) return; the_post_thumbnail('post-image'); }
Which seems to do the trick (apart from on the homepage), but I then hack to uncheck the "Include Featured Image?" option in Genesis -> Theme Options or I end up with two featured images.
June 15, 2016 at 7:07 pm #187630Brad DaltonParticipantNope. The code added the video on archives only and replaced the featured image.
To add the video on single posts, you will need more code.
You can also add a check for the genesis > theme settings > content archives > featured image settings using this:
if ( is_attachment() || ! genesis_get_option( 'content_archive_thumbnail' ) ) return;
-
AuthorPosts
- The forum ‘Design Tips and Tricks’ is closed to new topics and replies.