Forums Forums Search & Filter Pro Category description in search results

Viewing 10 posts - 1 through 10 (of 13 total)
  • Anonymous
    #236039

    Hello, I tried scouring WP Codex and this forum for the answer but couldn’t figure it out, I’m pretty limited in php. My search form has only as filters, and I want to display category descriptions above the results. How to achieve this?

    Anonymous
    #236040
    This reply has been marked as private.
    Trevor
    #236066

    Do you have an example of what you want it to look like, and are you able to send me a live link/URL to your search page so I can take a look?

    Anonymous
    #236074
    This reply has been marked as private.
    Trevor
    #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:

    https://support.searchandfilter.com/forums/topic/search-term-not-showing-on-custom-archive-page/#post-234049

    Having found the category term, you then need to refer to the WP Codex for code to fetch the description.

    Anonymous
    #236171

    Thank 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.

    Trevor
    #236174

    If you have a problem, do get back to me.

    Anonymous
    #236176

    Hello 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?

    Trevor
    #236179
    This reply has been marked as private.
    Anonymous
    #236213
    This reply has been marked as private.
Viewing 10 posts - 1 through 10 (of 13 total)