alvelig
Forum Replies Created
-
Andrew,
thank you, your link is really helpful, that plugin seems to be awesome. ?? But a bit sophisticated, so for the current project I won’t switch to it.
As for external link on slides, it’s possible using add_post_meta()/ get_post_meta(). I think you can use an a little outdated though useful plugin: https://www.ads-software.com/extend/plugins/media-custom-fields/ which adds custom fields to post attachments (media posts).
and then you’ll have to get your custom meta field with get_post_data()Sorry for not giving you a complete solution, but this should help resolve your problem.
Andrew,
that sounds right and so is it, but now I wonder, why the code above worked in my case without
return $gallery_html;
??Another thing: did you manage to do anything with MCE Rich Text Editor. I am looking for a solution to add gallery and its attributes not in HTML mode, but in Visual.
Hi Andrew!
Actually, i was editing the plugin files (inc/gallery-to-slideshow-class.php)… And the second post is more a feature request for the developers, than an out-of-the-box solution.
But as far as functions.php is concerned, I can assume that adding these lines to functions.php should do the job. Actually, i tested it, heh )
add_filter( 'post_gallery', 'my_hook_for_gallery', 11, 2 ); function my_hook_for_gallery ( $gallery_html, $attr ) { if( isset( $attr['slideshow'] ) ){ $params['slideshow'] = $attr['slideshow']; wp_localize_script( 'gallery-to-slideshow', 'mv_gallery_to_slideshow_js_params', apply_filters( 'mv_gallery_to_slideshow_js_params', $params ) ); } }
Update: the $attr[‘slideshow‘] can be any attribute of the gallery shortcode.
Had to take my head to the code and finally found a solution:
I moved
// FlexSlider Params $params = array( ... ); wp_localize_script( 'gallery-to-slideshow', 'mv_gallery_to_slideshow_js_params', apply_filters( 'mv_gallery_to_slideshow_js_params', $params ) );
from function enqueue_script() { … }
to
function gallery( $gallery_html, $attr ) { ... // FlexSlider Params $params = array( ... ); if( isset( $attr['slideshow'] ) ){ $params['slideshow'] = $attr['slideshow']; } wp_localize_script( 'gallery-to-slideshow', 'mv_gallery_to_slideshow_js_params', apply_filters( 'mv_gallery_to_slideshow_js_params', $params ) ); ... }