#
April 18, 2013 at 9:09 am
How can I display the tags under the category work but without their links? Just as plain text?
I have the part that collects all the tags from posts under the category Work but I do not know how to strip them of their link?
< ?php
$page_name = $wp_query->post->post_name;
$custom_query = new WP_Query(‘category_name=’. $page_name .’&posts_per_page=-1′);
if ($custom_query->have_posts()) :
while ($custom_query->have_posts()) : $custom_query->the_post();
$posttags = get_the_tags();
if ($posttags) {
foreach($posttags as $tag) {
$all_tags[] = $tag->term_id;
}
}
endwhile;
endif;
$result = count($all_tags);
if ( $result >= 1) { ?>
< ?php
$tags_arr = array_unique($all_tags);
$tags_str = implode(“,”, $tags_arr);
$args = array(
‘smallest’ => 13,
‘largest’ => 13,
‘unit’ => ‘px’,
‘number’ => 0,
‘format’ => ‘flat’,
‘separator’ => “n n n” ,
‘echo’ => true,
‘link’ => ”,
‘include’ => $tags_str
);
wp_tag_cloud($args);
?>
< ?php } else { ?>
No Tags!
< ?php } ?>< ?php
?>< ?php wp_reset_query(); ?>
Then lastly place each tag inside the mark up of:
TAG NAME GOES HERE