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]
Like:
$tags = get_tags();
mainecampus
Member
Posted 2 years ago #
As far as I know, both get_tags() and get_terms() can not be returned as arrays.
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>";
?>
mainecampus
Member
Posted 2 years ago #
Sweet, you're right, it worked. Thanks!