• One more time πŸ™‚

    I used part of your code from here:

    <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>

    It’s great in gallery but it doesn’t work on site which displays images with one of tags. Could you help me?

    https://wordpress.org/plugins/nextgen-gallery-voting/

Viewing 1 replies (of 1 total)
  • Plugin Author shauno

    (@shauno)

    When using the tag cloud, NGG messes with the URL, so line 8 of the snippet above doesn’t get the URL of the display page. You can try the code below, but this is outside of the scope of normal support πŸ™‚

    <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 = $_SERVER['PHP_SELF'];
    	$get = $_GET;
    	unset($get['nggv-order']);
    	$pageUrl .= '?'.http_build_query($get);
    
    	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>
Viewing 1 replies (of 1 total)
  • The topic ‘Sort order with tags’ is closed to new replies.