Hey guys,
For SEO reasons I want to display post tags, but not actually as links, just as text. Might sound strange but I promise you my reasons are sound. Can you advise what I would do to remove the links from my tags?
Thanks,
Adam
Hey guys,
For SEO reasons I want to display post tags, but not actually as links, just as text. Might sound strange but I promise you my reasons are sound. Can you advise what I would do to remove the links from my tags?
Thanks,
Adam
Take a look at this page, the first usage example looks like what you are asking for: http://codex.wordpress.org/Function_Reference/get_the_tags
Nope that didn't fix it. Any other ideas? Thanks for your help.
I believe get_the_tags works when in The Loop. Might need something like this outside The Loop.
<?php
$taxonomy = 'post_tag';
$title = 'Tag: ';
$args ='';
$terms = get_terms( $taxonomy, $args );
if ($terms) {
foreach($terms as $term) {
echo '<p>' . $term->name . '</p>';
//echo '<p>' . $title . '<a href="' . get_term_link( $term->term_id, $taxonomy ) . '" title="' . sprintf( __( "View all posts in %s" ), $term->name ) . '" ' . '>' . $term->name.'</a> has ' . $term->count . ' post(s). </p> ';
}
}
?>This topic has been closed to new replies.