• Is there a way to use the “medium” sized thumbnails on the most recent post and the “thumb” for all the others? Reading the docs, I had hoped something like this would work, but it has no effect:

    query_posts('showposts=1');
    	if (have_posts()) : while (have_posts()) : the_post(); ?>
    	<div id="recent-gallery">
    
    		<h2 class="recent-head">Recent</h2>
    		<div class="entry">
    			<?php
    				file_gallery_shortcode(array('size'=>'medium'));
    				the_content();
    			?>
    
    		</div>
    	</div>

    My php skills aren’t that great so any pointers would be greatly appreciated!

    Many thanks.

    http://wordpress.org/extend/plugins/file-gallery/

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author Aesqe

    (@aesqe)

    hey Raw-m 🙂

    file_gallery_shortcode function only returns values, it does not echo (print) them. all you have to do is add ‘echo’ in front of it, like this:

    query_posts('showposts=1');
    	if (have_posts()) : while (have_posts()) : the_post(); ?>
    	<div id="recent-gallery">
    
    		<h2 class="recent-head">Recent</h2>
    		<div class="entry">
    			<?php
    				echo file_gallery_shortcode(array('size'=>'medium'));
    				the_content();
    			?>
    
    		</div>
    	</div>
    Thread Starter raw-m

    (@raw-m)

    Hi Aesqe

    Great stuff, nearly there…!

    Is there a way to get the “echo file_gallery_shortcode(array(‘size’=>’medium’))” into the_content?

    Your example is basically echoing the gallery twice, first time (“echo file_gallery_shortcode(array(‘size’=>’medium’))”) just the gallery with the gallery size I’m after, the second (“the_content()”) using the thumb default size with post text. Ideally, I want the size=medium with my text from the post. Do I somehow need to filter out the gallery embeded in the_content to get what I need? Hope that makes sense!!

    Plugin Author Aesqe

    (@aesqe)

    Raw-m, please try File Gallery 1.6.5.1 – it’s still not a public release (it’s in the trunk as the development version), but you can download it from here: http://downloads.wordpress.org/plugin/file-gallery.zip

    then, after you install it, add this code before the_content();, replacing echo file_gallery_shortcode(array(‘size’=>’medium’)); with it:

    file_gallery_overrides(array('size'=>'medium'));

    this will override the arguments within the gallery shortcode for this post.

    let me know if it works ok for you 🙂

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘[Plugin: File Gallery] Different sized thumbs on recent post’ is closed to new replies.