I'm in the process of building my own Wordpress theme from scratch and my knowledge of PHP is limited. What I'm trying to do is insert tags below each post. I can do this by inserting code into my single.php file but I want to do this through the functions.php
file.
I have already inserted an author box below each post through the functions.php file. I got the code for that somewhere online and I would like to do the same thing with the tags.
Here is the author box code in my functions.php
file.
function get_author_bio($content='') {
global $post;
$post_author_name=get_the_author_meta("display_name");
$post_author_description=get_the_author_meta("description");
$html="<div class='author-box'>\n";
$html.="<h5 class='author'>About the author</h5>\n";
$html.="<div class='author-entry'>\n";
$html.="<img width='100' height='100' class='avatar' src='http://www.gravatar.com/avatar.php?gravatar_id=".md5(get_the_author_email()). "&default=".urlencode
($GLOBALS['defaultgravatar'])."&size=80&r=PG' alt='PG'/>\n";
$html.="<h6 class='author-name'>".$post_author_name."</h6>\n";
$html.= "<p>".$post_author_description."</p>\n";
$html.="</div>\n";
$html.="</div>\n";
$content .= $html;
return $content;
}
add_filter('the_content', 'get_author_bio');
It works great and it allows me to add HTML elements for easy CSS styling. I want something similar for the tags. Cab anyone help me?