[resolved] How to add tags in post and tag cloud at sidebar? (5 posts)

  1. jayjayc
    Posted 6 years ago #

    My site at http://www.jaycjayc.com/, using Theme Greed and WordPress 2.8.4.

    1. I'd like to know how to add post tags at the end of each post. Have read a similar resolved topic at http://wordpress.org/support/topic/301919?replies=3 and browse http://codex.wordpress.org/Template_Tags/the_tags, but still don't know how to go about it. WP documentation says that "Tags have to be enabled with the right code in your theme for them to appear in your post." Would appreciate if someone could teach me how-to in very simple terms and steps as I'm not so tech-savvy.

    2. Also, I'd like to add a Tag Cloud at the right sidebar. Have tried to add one, by going to Appearance > Widgets, then dragged the Tag Cloud widget to the right Sidebar 2 to activate, it did show but all the other features currently at the sidebar disappeared. So, dragged again to reposition the widget to Sidebar 3 instead, but no Tag Cloud appeared though the other features returned. Please advise.

  2. MichaelH
    Posted 6 years ago #

    1. Maybe an example will be easier to follow. Look at the WordPress Default theme's wp-content/themes/default/index.php file and see how it uses the_tags.

    2. If you can't add the Tag Could widget to your sidebar, then might consider changing to a different theme. If that is not possible, then in your theme's sidebar.php (or whatever Template controls your sidebar.php display) add the Template Tag, wp_tag_cloud().

    Stepping Into Template Tags
    Stepping Into Templates
    Template Hierarchy

  3. jayjayc
    Posted 6 years ago #

    Thanks so much, Michael for your assistance. By not presenting an easy solution to my queries, you've 'forced' me to read and reread what is so foreign and mind-boggling to a non-technical person. Delighted that I took up the challenge and learnt so much, though almost crack up my poor brain to solve both the issues. Just in case, others who are technically challenged like me would like these 2 features in their blog, here's the simple way already applied at my blog:

    To add post tags:
    1. Go to your site admin, select Editor > Single Post (single.php)
    2. Insert the following <p><?php the_tags(); ?></p> below the text <?php the_content() ;?> , bearing in mind that a template tag should be placed before this point <?php endwhile; ?> as indicated here: http://codex.wordpress.org/The_Loop_in_Action (this was the missing clue that solved the riddle for me!).

    To add a tag cloud
    1. As suggested by Michael, go to your theme's sidebar.php (can be found at your site admin | Editor).
    2. Insert the following to where you want it to appear. I had it inserted before <h2>Meta</h2> , your sidebar features may differ:

    li (place it within the these symbols <> )
    <h2>Tags (or whatever title you want)</h2>
    <?php wp_tag_cloud( $args ); ?>
    (place it within these symbols <> )

    Hope this helps.

    Thanks again, Michael. Really appreciate your response.

  4. donmetznik
    Posted 6 years ago #

    Thanks for your clarification. Question, how do I get to the Editor? I can't find it on my dashboard, except for editing the theme, and I can't find the single.php line there.

  5. taranfx
    Posted 6 years ago #

    you will have to open them in a code editor like dreamweaver/eclipse

    [signature moderated Please read the Forum Rules]

Topic Closed

This topic has been closed to new replies.

About this Topic