WordPress.org

Ready to get started?Download WordPress

Forums

Display all posts by using tag.php (14 posts)

  1. dudd, médecine blog
    Member
    Posted 4 years ago #

    Hi,

    Please how can i display all posts classed under a tag (by hacking my tag.php template) ?

  2. MichaelH
    Member
    Posted 4 years ago #

    Well if you use something like the Tag Cloud Widget, or the_tags() or wp_tag_cloud() in your theme, then WordPress will present links for your tags. Then when a particular tag is clicked, the Template Hierarchy will be followed and a display of posts in that tag will be presented.

    Now if you want to "customize" the way the posts in a particular tag are displayed then review the Tag Templates article.

  3. dudd, médecine blog
    Member
    Posted 4 years ago #

    Now if you want to "customize" the way the posts in a particular tag are displayed then review the Tag Templates article.

    That's what i need to use : how can the Tag Templates to display ALL POSTS classed in it ?

  4. MichaelH
    Member
    Posted 4 years ago #

    Again, you may not need to do anything. Switch to the WordPress Default theme and see how it displays tags with each post. Then click on one of those tags and see how the posts that belong in that tag get displayed. There is no tag.php with the Default theme -- WordPress and the Template Hierarchy use the archive.php in that theme to display the tag archives.

  5. dudd, médecine blog
    Member
    Posted 4 years ago #

    Yes i understund what you have written, In my theme i use tag.php (not archive.php)but what i need is to delete navigation (next / previous entries) to display all posts classed in the tag page (excuse my little english i am french ...)

  6. esmi
    Forum Moderator
    Posted 4 years ago #

    Assuming you want to show all of the posts on a single tag page, try adding <?php query_posts('&posts_per_page=-1');?> just before the start of the Loop.

  7. dudd, médecine blog
    Member
    Posted 4 years ago #

    I try that show all posts off all the blog not only posts classed under a single tag :-(

  8. houseofstrauss
    Member
    Posted 4 years ago #

    If you want a plugin try http://wordpress.org/extend/plugins/new-tag-cloud/ new tag cloud. I would also suggest hard coding it as shown above, but this is a small plugin and caches results for performance.

  9. dudd, médecine blog
    Member
    Posted 4 years ago #

    If you want a plugin try http://wordpress.org/extend/plugins/new-tag-cloud/ new tag cloud. I would also suggest hard coding it as shown above, but this is a small plugin and caches results for performance.

    Thank's, I have tested this plugin but it do not do what i have indicated above :-(

  10. Gerald
    Member
    Posted 4 years ago #

    If you want to fetch posts from a tag, use the query_post function.

    query_posts('tag=mydesiredtag');


    http://codex.wordpress.org/Template_Tags/query_posts#Tag_Parameters

  11. houseofstrauss
    Member
    Posted 4 years ago #

    Good call Gerald, funny how we miss the obvious sometimes!

  12. dudd, médecine blog
    Member
    Posted 4 years ago #

    Good funcion, but do not do what i need ...

    UP PLEASE...

  13. alchymyth
    The Sweeper & Moderator
    Posted 4 years ago #

    before the loop, try

    <?php global $query_string;
    query_posts($query_string . '&posts_per_page=-1');?>

    http://codex.wordpress.org/Template_Tags/query_posts#Usage_Note

  14. dudd, médecine blog
    Member
    Posted 4 years ago #

    Great ! it work thanks very match alchymyth

    before the loop, try

    <?php global $query_string;
    query_posts($query_string . '&posts_per_page=-1');?>

    http://codex.wordpress.org/Template_Tags/query_posts#Usage_Note

Topic Closed

This topic has been closed to new replies.

About this Topic