• Hi

    I have bought a theme that does not implement tags.

    I’m wondering if I could add a couple of lines of code to index.php or archive.php or single.php and then be able to use tags again.

    Here’s hoping you can help me!

    Luke

Viewing 9 replies - 1 through 9 (of 9 total)
  • Thread Starter lukeyounge-1

    (@lukeyounge-1)

    Hi thanks for your reply, but I think you may have misunderstood my problem.

    The link you sent does this “This template tag displays a link to the tag”

    My problem is more fundamental – when I select a tag, I get a list of ALL posts…

    Any other ideas?

    ok – can you explain in more detail what ‘does not implement tags’ means.

    – does the theme have no tags under the posts in the front page, archives, and single posts?

    – or is a tag archive missing?


    what i pointed to, would be added into the loop to show in a post, for instance either below the title, or after the content.

    but I still just get a list of everything…

    what would you like to achieve?

    maybe, a link to your site can help to illustrate your problem.

    Thread Starter lukeyounge-1

    (@lukeyounge-1)

    Wow that was fast!

    Here’s a link : https://www2.outtheboxfestival.com/tag/25-march-thursday/

    Lets chat when you’ve seen that.

    My problem is more fundamental – when I select a tag, I get a list of ALL posts…

    that answered my questions.

    you can start by creating a tag.php (for instance from a copy of archive.php or index.php);
    then check the code before the loop, particular if there is a query of any kind.

    it might be useful, if you paste the code of tag.php into a https://pastebin.com/ and post the link to it here.

    Thread Starter lukeyounge-1

    (@lukeyounge-1)

    Wow – you are super helpful!

    I’ve pasted archive.php and I think this is the link:

    https://pastebin.com/mernL8bA

    I’ve made a copy in the meantime and renamed it tag.php

    Thread Starter lukeyounge-1

    (@lukeyounge-1)

    I hope you found the code.

    i looked and did find the line:

    <?php query_posts(array('category_name' => single_cat_title('', FALSE), 'order' => 'DESC', 'orderby' => 'date', 'posts_per_page' => '-1')); ?>
                        <?php else: ?>

    I guess I should change it, but to what?

    Thanks again for all your help

    in your tag.php (which should be a copy of archive.php) delete the following section:

    <?php if (is_category()): ?>
                        <h1><?php single_cat_title(); ?></h1>
                        <?php query_posts(array('category_name' => single_cat_title('', FALSE), 'order' => 'DESC', 'orderby' => 'date', 'posts_per_page' => '-1')); ?>
                        <?php else: ?>
                        <h1><?php the_title(); ?></h1>
                        <?php get_search_form(); ?>
                        <?php query_posts(array('order' => 'DESC', 'orderby' => 'date', 'posts_per_page' => '-1')); ?>
                        <?php endif; ?>

    and replace with:

    <h1><?php single_cat_title(); ?></h1>
                        <?php query_posts(array('tag' => get_query_var('tag'), 'order' => 'DESC', 'orderby' => 'date', 'posts_per_page' => '-1')); ?>

    btw:
    this is quite a weird programmed archive.php for a bought theme (?)

    Thread Starter lukeyounge-1

    (@lukeyounge-1)

    You are a wp ninja genius!

    Thank you!!

Viewing 9 replies - 1 through 9 (of 9 total)
  • The topic ‘My theme has no TAG functionality’ is closed to new replies.