Forums › Forums › Search & Filter Pro › Category description in search results
- This topic has 12 replies, 2 voices, and was last updated 4 years, 9 months ago by Trevor.
-
Trevor(Private) March 10, 2020 at 2:52 pm #236129
Will you have results only for one single category, or many categroies?
If many, then will the results be sorted by category?
If many, what happens with posts that have more than one category, or do they only ever have one category?
To find the category term chose, see this post:
Having found the category term, you then need to refer to the WP Codex for code to fetch the description.
Anonymous(Private) March 10, 2020 at 6:27 pm #236171Thank you Trevor,
I should’ve been more specific. There will be only one category at a time chosen, and posts will only have one category. I’ve actually seen this post earlier when I was looking for a solution, but couldn’t wrap my head around it, I’ll try again.
Anonymous(Private) March 10, 2020 at 6:58 pm #236176Hello again, looks like my issue is very entry level but I’m still having trouble getting the selected category’s description.
I simply added <?php echo category_description(5); ?> into the results.php, so it displays the description of category ID “5”, but obviously this won’t show other categories’ descriptions when they’re selected. I expected it work if I leave the ID number out, but it didn’t. Any ideas?
-
AuthorPosts