Yes that would be easily achieved by adding the appropriate template tags to the article template.
From the FAQs:
In the plugin’s root directory you will find a folder called /template. You can override that folder and any of the files within, by copying them into your active theme and renaming the folder to /yourtheme/wp_knowledgebase
The template file for the Knowledgebase post is called single-kbe_knowledgebase.php
Thread Starter
cocool
(@cocool)
Hi,
Thanks for your reply.
Could you pls clarify this (I am not an expert):
1-adding the appropriate template tags to the article template
=> what are the template tags in this case? Is this a code to be inserted in the file single-kbe_knowledgebase.php and, if so, what code and where?
2- You can override that folder and any of the files within, by copying them into your active theme and renaming the folder to /yourtheme/wp_knowledgebase
=> pls explain. Do i simply create a new folder called wp_knowledgebase in my current (or child?) theme and add the above modified file single-kbe_knowledgebase.php?
Does this file have to be in a sub folder called /template?
like:
/mytheme/wp_knowledgebase/template/single-kbe_knowledgebase.php
-
This reply was modified 7 years, 9 months ago by
cocool.
Thread Starter
cocool
(@cocool)
Ok, I have added a folder to my theme named wp_knowledgebase and inserted a copy of the file single-kbe_knowledgebase.php.
=> /mytheme/wp_knowledgebase/single-kbe_knowledgebase.php
I have tested a few changes and they are taken into account.
All I need now is if you could simply give me the code to be inserted in the single-kbe_knowledgebase.php file so that the tags and categories show below the articles.
As mentioned, I am not an expert and would really appreciate a hint 🙂
Thanks a lot!
-
This reply was modified 7 years, 8 months ago by
cocool.
To display the tags in the knowledgebase article it should be enough to add <?php the_tags; ?> to the single-kbe_knowledgebase.php file. When I do that I can see the tags and they are all linked. But the link points to /tag/hashtag/ which is where the ”normal” tags are. And since the site doesn’t have any blog posts the result page only says ”Sorry, no content matched your criteria.” How do I point to the ”real” knowledgebase tags?
WP Knowledgebase posts sit in a custom post type so the_tags() and related functions will not work. You must use the_terms() and its related functions.
https://codex.wordpress.org/Function_Reference/the_terms
https://codex.wordpress.org/Function_Reference/wp_get_post_terms
Great! Thanks Maeve!
So after some digging I found out that ‘kbe_tags’ shows tags and ‘kbe_taxonomy’ shows categories.
I added this in single-kbe_knowledgebase.php to show the tags in an unordered list:
<p>Tags:<br /><?php the_terms( $post->ID, 'kbe_tags', '<ul><li>', '</li><li>', '</li></ul>' ); ?></p></div>
-
This reply was modified 7 years, 6 months ago by
pelles. Reason: Code
Thanks for sharing your solution @pelles – that’s super helpful for others 🙂