- This topic has 4 replies, 3 voices, and was last updated 5 years, 5 months ago by Adrian.
June 13, 2017 at 2:26 am #332823Adrian
I am stuck at a problem I’m not able to solve.
First of all, I have enabled the categories & tags to be shown below
the post / page title. This works fine!
The only issue is: I want to add a separator between the individual categories/tags.
Below is the code I use in GP Hooks. I can’t see any error, but still no comma separator is shown in the output.
Does anybody have an idea what might be wrong?
/*------- Show categories & tags below post/page title ------ */ $postid = get_the_ID(); $categories = get_the_category($postid); if ( ! empty($categories) && is_page( $postid ) ) : $categories_list = get_the_category_list( _x(', ', $postid ) ); $tag_list = get_the_tag_list( _x( '', ', ', '', $postid ) ); ?> <div class="entry-meta"> <span class="categories_links"> <? echo $categories_list; ?></span> <span class="tag_links"> <? echo $tag_list; ?></span> </div> <?php endif; ?>GeneratePress 1.3.48June 13, 2017 at 8:57 am #332988TomLead DeveloperLead DeveloperJune 13, 2017 at 11:41 am #333040Adrian
Hi Tom, hi Leo,
I now found out what caused the issue (or where the problem my lie).
I am using a plugin that enables categories & tags for pages. Normally you can only categorize and tag posts. The separator is correctly inserted on posts, but not on pages.
A bit stupid, but anyway. I think I’ll go for the CSS solution, unless you know a magic trick 🙂 It’s not a Generatepress issue so I don’t want to waste your time.
Thanks for your help!
AdrianJune 13, 2017 at 11:55 am #333048LeoStaffCustomer SupportJune 13, 2017 at 11:40 pm #333270Adrian
I closed the thread.
- You must be logged in to reply to this topic.