WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] How To Add Tags Without Links (12 posts)

  1. soulsmasher
    Member
    Posted 6 years ago #

    Hi, i want to use tags without links. I'll show them, but only as plain text. because i'll use them on title, like i have been using in UTW

    is there any way to do them? i've read the documents and couldn't find a way :(

    thanx

  2. soulsmasher
    Member
    Posted 6 years ago #

    any ideas ? :(

  3. Chris_K
    Member
    Posted 6 years ago #

  4. Samuel Wood (Otto)
    Tech Ninja
    Posted 6 years ago #

    For use in a post, I'd say this:
    <?php echo strip_tags(get_the_tag_list('',', ','')); ?>

    Dunno if that would work in the title. get_the_tag_list is a Loop thing.

  5. soulsmasher
    Member
    Posted 6 years ago #

    neither single_tag_title (i even tried single cat title) nor striping post worked.

    i used this code in title

    <?php if (is_tag()) { ?>
    <?php echo 'Articles tagged with: '; ?>
    <?php single_tag_title(); } ?>
    but shows nothing

    even tried without any if queries, but no result :( it shows nothing.

    even tried this one

    <?php if ( is_single() ) { single_tag_title(); } ?>

    even the_tags(); didn't work on header.php

    i ported my theme from 2.2 to 2.3, i checked default theme codes, but not en extra code included. do i have to add some lines to header.php?

  6. Root
    Member
    Posted 6 years ago #

    It needs to be in array surely?

  7. Christopher
    Member
    Posted 6 years ago #

    This plugin has a function to list tags in plaintext - perhaps it could be of use...
    http://www.herewithme.fr/wordpress-plugins/simple-tags

  8. Chris_K
    Member
    Posted 6 years ago #

    Huh. The link I gave shows how I show tags in title (in 2.3). Not sure why that wouldn't work for anyone else.

  9. soulsmasher
    Member
    Posted 6 years ago #

    okay, i see how it works.. when i go to a tag page (posts which are tagged with that), it shows the tag

    but what i want is to show all the tags for the simple post page...

    i mean,
    <?php if ( is_single() ) { single_tag_title(); } ?>
    how can this code (or something like this) work ??

    thanks for help :)

  10. soulsmasher
    Member
    Posted 6 years ago #

    any ideas ?? :(

  11. Samuel Wood (Otto)
    Tech Ninja
    Posted 6 years ago #

    Well, the code I posted will work in the Loop, however if you're doing this somewhere else, outside the Loop, then you need to take special measures.

    Like, if you were doing it in the header.php:

    <?php
    if (is_single()) { the_post(); rewind_posts();
    echo strip_tags(get_the_tag_list('',', ',''));
    } ?>
  12. soulsmasher
    Member
    Posted 6 years ago #

    @otto42, Worked like a charm, Thanks so much :)

Topic Closed

This topic has been closed to new replies.

About this Topic