Home Forums General Issues Sort by custom text(number) Reply To: Sort by custom text(number)

  • You would need to output them into the links, for example;

       // whatever function would be used to get the link for the current page
       $link = get_the_permalink();
    <a href="<?php echo $link; ?>?myvar=ASC">123</a>
    <a href="<?php echo $link; ?>?myvar=DESC">321</a>

    then you need to alter the query run on the page to add a meta_query. You can find an example of that in the link I gave before and there is more information in the WP documentation