WordPress.org

Ready to get started?Download WordPress

Forums

How to set the archive.php to be invoked after clicking on tags in tag cloud? (5 posts)

  1. kanote
    Member
    Posted 2 years ago #

    Template i use (some template that i found in internet and customized) uses standard (default) WordPress archive system. In the sidebar, i've placed widget with tag list (tag cloud). When i click on tag, the posts belonging to clicked tag are being shown, as an archive page.

    But this archive page looks like normal start page and i want to customize it a lot.
    I now that i must use archive.php file to achieve this, but i don't know how to set this file, to be included after clicking on prefered tag.
    I've browsed through my template code and didn't found any code line that would help achieving this.

    So i'm asking for help - what function and where i should to put into my template code to include the archive.php (the archive page with listed tagged posts on it) to be shown everytime guest will click on tag to show posts tagged with it?

    Cheers

  2. alchymyth
    Forum Moderator
    Posted 2 years ago #

    try to read http://codex.wordpress.org/Template_Hierarchy to get an understanding what template gets automatically called when, for instance, clicking on a tag in the tag cloud.

  3. kanote
    Member
    Posted 2 years ago #

    Few words were helpful, but still no idea how can i hook the archive.php template to tag cloud widget.

  4. alchymyth
    Forum Moderator
    Posted 2 years ago #

    if your theme has the template tag.php, this will be used when clicking on a tag in the tag cloud;
    else
    if your theme has the template archive.php, this will be used when clicking on a tag in the tag cloud;
    else
    if your theme has none of the above templates, index.php will be used when clicking on a tag in the tag cloud.

    if your theme displays any odd behaviour, please post a link to your site to illustrate.

  5. kanote
    Member
    Posted 2 years ago #

    Ok thanks. Now it works. This didn't worked, because i've mispelled the file name - instead archive.php i named it archives.php. Now it works fine :)

    Thanks and cheers.

Topic Closed

This topic has been closed to new replies.

About this Topic