• Resolved chea24

    (@chea24)


    Here is sort by title: /?order=asc&orderby=title

    How do I get a link like that for meta key and meta value num?
    I’m trying to sort my custom taxonomy terms by meta key and meta value num. I have about 10 categories that I would like to do this for.
    Can anyone help me with this?

Viewing 3 replies - 1 through 3 (of 3 total)
  • Thread Starter chea24

    (@chea24)

    Yes. And after reading that and various forums my solution was to create a template file for every taxonomy and enter this code:

    $wp_query->query(‘meta_key=views_count&orderby=meta_value_num&post_type=yabba’.’&paged=’.$paged);
    ?>

    Then create pages for every taxonomy and assign the page templates for every page.

    But there is probably a better solution. Any help?

    [No bumping. If it’s that urgent, consider hiring someone.]

    Thread Starter chea24

    (@chea24)

    Okay I solved my problem using a plugin. I try to avoid plugins but my coding experience is minimal so I gave up and went with a plugin.

    I wanted to allow users to sort posts on the front end by most popular via url link. I was able to do this with WP-Postviews Plugin. The plugin tracks post views and if you want to sort by most viewed you can add a line of code to a php file or you can simply add this to the end of a url:

    /?v_sortby=views&v_orderby=desc

    It works with custom post types and custom taxonomies.

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘How To Sort Custom Taxonmy By Meta Key and Meta Value Num?’ is closed to new replies.