• The more I work with this plugin the more i wonder how hard it would be to have more than one gallery. It looks like based on the method of entering videos you can add other information like assigning categories for videos. I was wondering if you could sort using that information and create unique galleries?

Viewing 11 replies - 1 through 11 (of 11 total)
  • Plugin Author silviapfeiffer1

    (@silviapfeiffer1)

    Can you explain what the difference would be between the different galleries? Would they contain different videos or just a different ordering?

    The short code already has a feature [external-videos feature=”embed”] which allows to just display the very latest video. So, there is already a means to give it parameters. What parameters are you after?

    Thread Starter jhanten

    (@jhanten)

    First off, I am really impressed with how quickly you responded to my message. Thank you.

    I’m trying to have multiple pages on my website displaying videos. I have one with everything, but would also like to have pages with specific types of videos. For example a page just display testimonials apart from other topics. It looks to me like the mechanism for storing videos also allows for those videos to have their own categories. I just don’t see any way to access that stored information to tell the plugin to only show a certain category on a page.

    Does that make sense?

    Thank you for your time and have a great day.

    Thread Starter jhanten

    (@jhanten)

    I solved my own problem by adding the following to your ev-shortcode file. It seemed to work great. Thank you for such a nice plugin.

    } else if ( $feature == 'testimonials' ) {
    
      // extract the videos for the gallery
        $params = array(
    	  'cat'=>60,
          'posts_per_page' => 20,
          'post_type'      => 'external-videos',
          'post_status'    => 'publish',
    	  'order' => 'DESC',
        );
        $old_params = $wp_query->query;
        $params['paged'] = $old_params['paged'];
        query_posts($params);
    
        // display the gallery
        display_gallery($width, $height);
    Plugin Author silviapfeiffer1

    (@silviapfeiffer1)

    Nice one! I’m going to do some work over the next month on the plugin and maybe I can add this generally as a feature.

    I’d like to use that code, but I don’t know where exactly in the file I should put it. Could any of you help me?

    P.S. I love this plugin!

    EditRT

    (@editrt)

    HI Jhaten,

    I’m trying to modify the ev-shortcode.php, can you please tell me where exactly did you add your lines?

    thanks!

    Thread Starter jhanten

    (@jhanten)

    You add it to the end of the following if statement:

    if ( $feature == 'embed' ) {
        $params = array(
          'posts_per_page' => 1,
          'post_type'      => 'external-videos',
          'post_status'    => 'publish',
        );
        query_posts($params);
        if ( have_posts() ) {
          // extract the video for the feature
          the_post();
          $videourl  = get_post_meta(get_the_ID(), 'video_url');
          $video = trim($videourl[0]);
          // get oEmbed code
          $oembed = new WP_Embed();
          $html = $oembed->shortcode(null, $video);
          // replace width with 600, height with 360
          $html = preg_replace ('/width="\d+"/', 'width="'.$width.'"', $html);
          $html = preg_replace ('/height="\d+"/', 'height="'.$height.'"', $html);
    
          // just print the embed code for the newest video
          echo $html;
        }

    Good luck. I afraid I can’t help you any further. Silvia created a great plugin and I found customizing it pretty easy once she pointed me in a direction. Hopefully you will find the same to be true.

    J

    I’d like a little expanding on this if possible, what I would like is to have 1 gallery separated by the different categories.

    I attempted to use the code jhaten posted, but I’m sure I did something wrong.

    else if ( $feature == 'testimonials' ) {

    Is the ($feature == ‘testimonials’) referring to the category name?

    Hi, first of all thanks to Silvia for great plugin.
    I had the same category problem I used the code from jhanten with a little improvement to use custom category based on category name, the code is:

    after line 46:
    'cat' => '',
    to inizialize the parameter.

    And at the closure of “embed” if:

    else if ( empty($cat) == false ) {
    		$cat_id = get_cat_id($cat);
    	    // extract the videos for the gallery
    		$params = array(
    		  'cat'=>$cat_id,
    		  'posts_per_page' => 50,
    		  'post_type'      => 'external-videos',
    		  'post_status'    => 'publish',
    		  'order' => 'DESC',
    		);
    		$old_params = $wp_query->query;
    		$params['paged'] = $old_params['paged'];
    		query_posts($params);
    
    		// display the gallery
    		display_gallery($width, $height);
      }

    In this way I can use [external-videos cat=’category name’].

    I’ve used the modified plugin here:
    https://www.hwalmoodo.it/?page_id=244
    https://www.hwalmoodo.it/?p=418

    Thanks, I hope this helps.

    Thank you so much!!! That worked!

    BIG thanks to Silvia for this great plugin, and thanks to francodag & jhanten for the adjustments!

    Plugin Author silviapfeiffer1

    (@silviapfeiffer1)

    yes, great work francodag – I’ll include it in the next release if that’s ok

Viewing 11 replies - 1 through 11 (of 11 total)
  • The topic ‘[Plugin: External Videos] A way to have multiple galleries based on Categories?’ is closed to new replies.