-
Notifications
You must be signed in to change notification settings - Fork 19
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Plugin still not working with Genesis child themes #5
Comments
I was in contact with StudioPress as well. At this point there is no way for me to hook into their framework's functionality for featured images. They do not make use of the native WordPress functions but implement their own: WordPress' functions provide ways to hook into, their's do not. |
To add the featured video above the entry content (perhaps as an option if Genesis is detected?):
What you get in the Sample theme: If you want to replace the built in "Featured Image on Content Archives" functionality (and the child theme hasn't overridden that):
YMMV with other Genesis child themes, but this covers the Genesis core functions. Hope it helps ;-) |
Hey Nick I got the first code snippet to work awesome! call_user_func_array:{/Users/joachim/Documents/Websites/newsite.dev/wp-includes/plugin.php:503} ( ) call_user_func_array:{/Users/joachim/Documents/Websites/newsite.dev/wp-includes/widgets.php:1319} ( ) call_user_func_array:{/Users/joachim/Documents/Websites/newsite.dev/wp-includes/plugin.php:213} ( ) But the main thing is that the first code snippet works great! |
Don't use do_shortcode https://kovshenin.com/2013/dont-do_shortcode/ |
@nciske Comes from Automatic so i assume its spot on. 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; } } |
I stand corrected, thanks for pointing that out @braddalton. Here's a way to have your shortcode, without the overhead: https://gist.github.com/nciske/3b186cbc91b48d685679 |
Good stuff @nciske. Are you going to add that to the plugin? Looks like it didn't make it into core. So we use something like this via the child themes functions file: add_filter( 'genesis_pre_get_image', 'featured_video_plus_genesis_override', 10, 2 ); function featured_video_plus_genesis_override( $output, $args ){ if( $args['context'] == 'archive' && function_exists('has_post_video') && has_post_video()) { return run_shortcode( 'featured-video-plus' ); } else { return $output; } } |
Thanks for investigating! I will probably include this in the next update. Instead of return get_the_post_video(); |
So I just looked into this and am not so sure if I will actually implement this. The problem I see is that the |
Agree. I wouldn't add a genesis filter as it's not a genesis specific plugin and you're going to find it won't work in all cases. If you wanted to make a genesis specific plugin for featured videos, you could check out the genesis featured posts widget included in genesis as a starting point. |
I got a featured image conditional working for single entries as well. |
Hello Tom Wouldn't you use add_action('genesis_before_entry','your_function'); rather than add_filter |
Thanks, Brad. Both work, actually, but I'm inferring that it's a best-practice to use add_action? |
I think so unless you're using a filter to modify an existing function. |
Hi,
In short, frontend.min.js (NOT minify for practical reasons) // preload images
// [fvpdata.playicon, fvpdata.loadicon].forEach(function(val) {
// $('body').append($('<img/>', {src: val, alt: 'preload image'}).hide());
// });
// });
//})(jQuery);
// replaced from old version
initFeaturedVideoPlus();
});
})(jQuery); screenshot showing the problem: http://i.imgur.com/mcVRntA.jpg My question is: do you think I have done a foolish thing? |
I managed to get it working (i.e. featured video replaced featured image on single posts and archives) by adding this to my functions.php file and then unchecking 'Include the Featured Image?' in Genesis -> Theme Settings > Content Archives
|
@pseudomac Is this still a problem? Somehow I missed your reply, and haven't encountered it myself. |
I posted the following at the studiopress forum (some time ago):
Hey
I was trying to get the Featured Video Plus plugin https://wordpress.org/plugins/featured-video-plus/
to work with my child theme but it did not function. I e-mailed the author and he told me the following:
The automatic featured image replacement does not work for all themes – the Genesis Framework being one of them (there are many requests for this in the forum). I already was in touch with the developer but they do not intend to change their propitiatory API (they do not use WordPress’ native API).
How would we get the plugin to work with Genesis themes?
The developer is also working on the next version of Featured Video Plus which is located on Github:
https://github.com/ahoereth/featured-video-plus/tree/2.0.0
Any ideas as to what we can do about it?
What work around can be done?
Thanks.
The text was updated successfully, but these errors were encountered: