lundi 5 octobre 2015

Display meta of custom gallery settings on frontend

I have created custom gallery setting fields by this code:

<script type="text/html" id="tmpl-slideshow-gallery-settings">
    <label class="setting">
      <span><?php _e('Display'); ?></span>
      <select data-setting="slideshow_attr">
        <option value="default"> Default gallery </option>
        <option value="zzlslideshow"> Slideshow </option>
        <option value="masonry"> Masonry gallery </option>
      </select>
    </label>
        <label class="setting">
        <span><?php _e('imgwidth'); ?></span>
        <input type="text" value="" data-setting="imgwidth_text" style="float:left;">
    </label>
        <label class="setting">
        <span><?php _e('imgheight'); ?></span>
        <input type="text" value="" data-setting="imgheight_text" style="float:left;">
    </label>
</script>
<script>

    jQuery(document).ready(function(){

      // add your shortcode attribute and its default value to the
      // gallery settings list; $.extend should work as well...
      _.extend(wp.media.gallery.defaults, {
        slideshow_attr: 'zzlslideshow'
      });

      // merge default gallery settings template with yours
      wp.media.view.Settings.Gallery = wp.media.view.Settings.Gallery.extend({
        template: function(view){
          return wp.media.template('gallery-settings')(view)
               + wp.media.template('slideshow-gallery-settings')(view);
        }
      });

    });

</script>

But now i could use al little help: How to get the values of my settingfields and display in frontend. By example when option slideshow is chosen i want to display flexslider2 on frontend. Can annyone tell me how to do so?



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire