• Resolved kountz

    (@kountz)


    Hi,

    I’m trying to run my two separate blog pages and i’m trying to figure out how best to do this.

    Ideally i would tag all off one set with a ‘page1’ tag and all the rest with a ‘page2’ tag. when you click on the nav for page1 it would only request the posts that are tagged with ‘page1’…you get the idea.

    Is this possible and if so can anyone point me in the right direction??

    I’ve been having a look at get_tag() but it doesn’t seem to be able to do what i need to.

    Any help is greatly appreciated!!

Viewing 4 replies - 1 through 4 (of 4 total)
  • Using the Template Tag, the tags(), will provide the tag links for each post, then when the user clicks on a link, WordPress will display the tag archive using the correct Tag Template as dictated by the Template Hierarchy.

    Thread Starter kountz

    (@kountz)

    Thanks MichaelH,

    Would that not just provide me with a list of post links rather than a set of actual posts?

    i’m looking to replace this: the_content();

    with something along the lines of this in the loop:

    <?php if(has_tag(‘Work’) {
    the_content();
    } ?>

    I might be missing what you are asking…

    For grins, switch to the WordPress Default Theme, create a few posts with your tags, add the Tag Clould Widget to the sidebar and play with how the navigation to Tag Archives works.

    Discussion of archives:
    Don’t be confused by what an archive is–it is just a generated display of your posts at that moment. You don’t do anything to create the archive, that’s an automatic thing WordPress does for you. Usually, archives are date, category, tag, or author, based.

    Access to archives is typically presented via links in a sidebar under an Archive (date based), Category, or Tag Cloud, heading. Widgets, or Template Tags, such as wp_get_archives(), wp_list_categories(), wp_tag_cloud(), and wp_list_authors(), are the constructs used to present links to users to visit your various archives. The process of placing code in your Theme’s Templates is explained in Stepping Into Templates and Stepping Into Template Tags.

    Once a user clicks on a Category link in the sidebar, the display of those posts can be controlled by a Category Template. Other Templates, such as Author Templates, and Tag Templates, are available if you set them up. These Templates can be coded via Template Tags such as the_title(), the_content(), or the_excerpt(), to display just a post title, the full content of the post, or just an excerpt of the post.

    Also, it is important to understand the Template Hierarchy, as that is how WordPress determines what Template to use to render the posts for reading by your readers.

    If a user visits a Category archive, then clicks on a given post title in that Category archive, the display of that single post is again presented by another Template, and again, the Template Hierarchy determines what Template displays that single post. Finally, that single post Template can be coded to display just the title, the full post content, or an excerpt.

    Hope that isn’t too much to digest ??

    Thread Starter kountz

    (@kountz)

    Thanks,

    I ended up using:

    query_posts(“category_name=Blog”);

    in index.php which worked a treat.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Get all posts with a certain tag?’ is closed to new replies.