1

I have tag url - example.com/tag/new-shoes and I have 2 posts tagged with those keywords new-shoes.

I would like to display on this url example.com/tag/new-shoes all posts (titles and first keywords from posts) tagged with new-shoes.

I have a problem, because url example.com/tag/new-shoes shows me exactly the same page like main page of my website.

I can not see titles of posts assigned to this tag.

I will be grateful for help. Best, Peter

2
  • Are you sure? wordpress would have to do what you say by default. You could provide real url to verify?
    – nicogaldo
    Commented Mar 22, 2016 at 19:51
  • 1
    does your theme have a tag.php?
    – Michael
    Commented Mar 23, 2016 at 2:05

1 Answer 1

3

I would recommend giving the wordpress tag template page a read but the basic idea of what you want to do is something like this:

Create a tag.php fileand place it in your template. This file will act like any other wordpress template and allow you to use "The Loop" which will allow you to cycle through each post that matches the url and display the info however you'd like.

<?php 
    if ( have_posts() ){
        while ( have_posts() ) {
            the_title();  //Displays the post title
            the_excerpt(); //Displays the post excerpt
        } 
    } 
?>

That block, inside tag.php will do what you are basically looking for in an extremely basic way. Add HTML wrappers and/or call different functions to achieve the look you are going for.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.