Forums

[resolved] All tags in an array w/out links (5 posts)

  1. mainecampus
    Member
    Posted 2 years ago #

    Right now I'm using the automatic tag link on my site, but it just links to the tags the article is tagged with. I would like it to link to any tag on the site. I tried using wp_tag_cloud with format=array, but it doesn't return the raw tags — it has the links built it.

    Here's what's used right now:
    $tags=wp_get_post_tags($id);
    I'd like to turn it into something like this:
    $tags=wp_get_all_tags();

    [moderated--bump removed. Please refrain from bumping as per Forum Rules]

  2. MichaelH
    Volunteer
    Posted 2 years ago #

    Like:

    $tags = get_tags();
  3. mainecampus
    Member
    Posted 2 years ago #

    As far as I know, both get_tags() and get_terms() can not be returned as arrays.

  4. MichaelH
    Volunteer
    Posted 2 years ago #

    Did you try it? You want tags without them being 'linkified'. Be brave, put this right before the <?php if (have_posts()) : ?> in the wp-content/themes/default/index.php file, switch to the WordPress Default theme, visit the blog, and read the results:

    <?php
    $tags = get_tags();
    echo "<pre>"; print_r($tags); echo "</pre>";
    ?>
  5. mainecampus
    Member
    Posted 2 years ago #

    Sweet, you're right, it worked. Thanks!

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags