• Joe

    (@shopping-guide)


    When you create a Page, is there any method available to include blog Posts which have been tagged with a specific ‘XYZ-Tag’, and preferably include a pagination menu too (i.e. page 1, 2, 3, 4 etc).

    We are aware that you can create tags and categories, but these appear under deeper sub-directories like example.com/blog/tag/page/ or example.com/blog/category/page/ but we would rather have the posts for a few tags displayed under a cleaner url like example.com/blog/page/

    Can it be done easily and if so, how? Thanks.

    Joe

Viewing 3 replies - 1 through 3 (of 3 total)
  • Yes – using a custom query.

    Thread Starter Joe

    (@shopping-guide)

    That works nicely, thank you.

    Any idea how to get it to work with the pager?

    <?php query_posts( 'tag=xyz-widget&posts_per_page=30' ); ?>

    At the moment, it generates the pager links at the bottom, but clicking through to page 2 like example.com/blog/pagename/page/2/ just shows the same content from page 1.

    Joe

    <?php
    $paged = (get_query_var('paged')) ? get_query_var('paged') : 1;
    $args= array(
    	'tags' => 'xyz-widget',
    	'posts_per_page' => 30,
    	'paged' => $paged
    );
    query_posts($args);
    ?>
Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘How To Display XYZ Tagged Posts In A Page?’ is closed to new replies.