WordPress.org

Support

Support » Plugins and Hacks » [Resolved] sort order

[Resolved] sort order

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

    @shauno

    Hi fmonserrate

    Are you talking about the widget, or the just the normal gallery view?

    Hello Shauno,

    Thanks for your reply

    I talk about normal gallery view.

    Best Regards

    Plugin Author shauno

    @shauno

    You can use the call <?php nggv_orderImages($images); ?> call at the top of the gallery template to order the image if you are using the Premium add-on.
    See my site for more info on the options you can set.

    Hi Shauno,

    I try insert the call but i can´t put that working well.
    If i put the call on top like this:
    <a href="<?php nggv_orderImages($images); ?>">Most Voted</a>
    All pictures always will be sorted by “most voted” criterion. (not need click in link).

    I need pictures sorted by default with “most recent” and 2 links with “Most Voted” and “less Voted”

    There are any way to get this ?

    Best regards

    Plugin Author shauno

    @shauno

    That is a little outside of the scope of what the plugin does, but I’ve hacked some code up for you that should work. Add this at the top of the gallery.php file:

    <div class="order-links">
    	<?php
    	if($_GET['nggv-order'] == 'desc') {
    		nggv_orderImages($images, 'desc', 'last');
    	}else if($_GET['nggv-order'] == 'asc') {
    		nggv_orderImages($images, 'asc', 'first');
    	}
    	$pageUrl = get_permalink($ID);
    	if(strpos($pageUrl, '?') !== false) {
    		$pageUrl .= '&';
    	}else{
    		$pageUrl .= '?';
    	}
    	?>
    	<a href="<?php echo $pageUrl ?>">Default</a>
    	<a href="<?php echo $pageUrl ?>nggv-order=desc">Hightest Rated</a>
    	<a href="<?php echo $pageUrl ?>nggv-order=asc">Lowest Rated</a>
    </div>

    The ‘Default’ ordering can be tweaked using custom fields. You can read up on how NGG uses those on their site here.

    Hi shauno!

    You are a amazing! 🙂

    It was really what I needed!THANK YOU!

    and Thanks for this GREAT SUPPORT!

    I think “default” option = “Most Recent Images”, right?
    Is it possible get “Oldest Images” too?

    I mean sort by Date.

    Only missing link for “Oldest Images”, because “default” already get “Most Recent”
    This is possible?

    Best Regards

    Plugin Author shauno

    @shauno

    The default just shows the list as it normally would. You can alter the order of that list with the custom fields I linked to in my last post, but I don’t know how to make that dynamic and changeable with a link, sorry.

    Hello,

    I saw now, there is a new version (2.4). If I do the update I will lose all the changes I’ve made?

    Best Regards

    Plugin Author shauno

    @shauno

    Hi fmonserrate

    You won’t lose this change if you update NGG Voting, as this file is part of NGG. You will lose it if you update NGG though.

    If you want, you can move all the templates inside NGG’s ‘view’ directory, to a new directory named ‘nggallery’ inside your theme. NGG will then load them from there, and they won’t be overwritten when you do need to update NGG.

    Let me know if there are any more question 🙂

    Hello!

    Thank’s for your reply.

    As usual a great support here…:)

    Best Regards

Viewing 11 replies - 1 through 11 (of 11 total)
  • The topic ‘[Resolved] sort order’ is closed to new replies.