Welcome to the Question2Answer Q&A. There's also a demo if you just want to try it out.
+1 vote
390 views
in Q2A Core by
edited by

Is there a way to add icon for a tag or category?

I think it would be a nice feature to edit tags from admin panel and to be able to add an icon to categories and tags.

 

Update: Actually i found a way for tags but i just need to know how to do this:

 

In the following function if i can just add the tag name to the class i can add icons through css.
 
function post_tag_item($tag, $class)
{
$this->output('<LI CLASS="'.$class.'-tag-item">'.$tag.'</LI>');
}
 
Couldnt figure out categories though..
by
How i can just get the tag name ?

1 Answer

0 votes
by
 
Best answer

You can get the tag name inside function post_tag_item($tag, $class) by using strip_tags($tag) - note that the strip_tags() function name is based on the idea of HTML "tags", not Q2A's "tags".

You can use the same method to get the category name from $post['where']['data'] inside function post_meta($post, ...)

by
Great it worked for tags :) ill try for categories

Thanks
...