• Resolved niklas.sven

    (@niklassven)


    <?php query_posts(array('showposts' => 50, 'post_type' => 'post_type_animal', 'meta_key' => 'views', 'orderby' => 'meta_value_num', 'order' => 'DESC', 'paged' => $paged,)); ?>

    This code works fine, but it ignores post_type, it shows all post types.

    Can you help me to get this work?

    https://ww.wp.xz.cn/plugins/wp-postviews/

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

    (@gamerz)

    What does this has to do with the plugin? The code looks correct (besides the trailing comma)

    so I am guessing your post_type_animal is invalid. It might be just animal

    Thread Starter niklas.sven

    (@niklassven)

    Maybe this is not plugin issue then. The query is working other parts on the site but when I like to filter views by post types, it does not work.

    Post type is post_type_animal, cause I created it that way.

    Thanks for answer, I must research this issue more.

    Plugin Author Lester Chan

    (@gamerz)

    I recommend using http://generatewp.com/post-type/ to generate the custom post type code to add to your theme/plugin,

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

The topic ‘Get views by custom post types?’ is closed to new replies.