well, this code fetches the category list and display it in the theme in which the post is assigned. I want to add nofollow tag to this out list. I surfed the net and couldn’t find a solution. The only solution I found was to modify the wordpress core files. But I don’t want to modify the core files.
<footer class="entry-meta">
<?php
/* translators: used between list items, there is a space after the comma */
$category_list = get_the_category_list( __( ', ', 'basically' ) );
$meta_text = __( 'Category: %1$s', 'basically' );
printf(
$meta_text,
$category_list,
get_permalink(),
the_title_attribute( 'echo=0' )
);
?>
Any other way?
It will work inside
the_loop()
, to use it outside the loop you have to provide the post id onget_the_category()
so it should beget_the_category( $post->ID )
.Try this too: