Enable custom page by permalinks in WordPress

I wonder how to create a page which will sort post by views. I’ve made custom page template with sorting and it works fine

 <?php $current_category_ID =  getCurrentCatID(); ?>
 <?php $args = array(
          'posts_per_page' => 60,
          'cat' => $current_category_ID,
          'meta_key' => 'views',
          'orderby' => 'meta_value_num',
          'order' => 'DESC',
     ); ?>

     <?php query_posts($args); ?>

     <?php if (have_posts()) : ?>

I’ve created menu in page category, with position popular, but i don’t know how to enable this page becasuse i’ve problems with permalinks.

Page should have url: sitename.com/%category%/popular-category

How to do this?

Read more here: Enable custom page by permalinks in WordPress

Leave a Reply

Your email address will not be published. Required fields are marked *