• Resolved jensrathmann

    (@jensrathmann)


    Hello,
    I need your help! I created approx. 200 categories. Each category has one parent category. You can see these on my site: Business sector, services, product groups and special product groups (4 parent categories) And there are 20 posts.

    I connected the categories to the suitable posts. I connected the child to one parent category.
    Now I want to display only one of the four parent categories and its child categories. Not the other 3 parent categories and its child categories. The code…

    [show_post_categories show=”category” parent=”no” parentcategory=”business-sector” id=”454]

    is not correct.
    Please help me.
    Best regards
    Jens

    The page I need help with: [log in to see the link]

Viewing 10 replies - 1 through 10 (of 10 total)
  • Plugin Author willemso

    (@willemso)

    Hello Jens,

    could you clarify if you want to show the categories linked to the post itself, or categories from another post? I think I might be missing something: -)

    Can we build the shortcode step by step to see where / what goes wrong?
    So for instance what happens when using;

    [show_post_categories show="category"]
    [show_post_categories show="category" parent="no"]
    [show_post_categories show="category" parent="no" parentcategory="business-sector"]

    Thread Starter jensrathmann

    (@jensrathmann)

    Hello,

    i want to show all the child categories of one parent category from one post at a page site.

    [show_post_categories show=”category”] = all categories are displayed (ok)

    [show_post_categories show=”category” parent=”no”] = all child categories and no parent category are diyplayed (okay)

    [show_post_categories show=”category” parent=”no” parentcategory=”business-sector”]
    = nothing happens

    I tried:
    [show_post_categories show=”category” parent=”no” parentcategory=”business-sector” id=”454] = I thought that all child and parent categories are shown except the parent category business sector and its child categories.

    Theoretically, this code should be the solution for my task.

    [show_post_categories show=”category” id=”454″ parent=”no” parentcategory=”business-sector” parentcategory=”services” parentcategory=”product-groups”] = That means that only the child categories of the last parent category “special-product-groups” from the post 454 (id) are displayed.

    Best regards
    Jens

    Plugin Author willemso

    (@willemso)

    Hey Jens

    To be sure you have used the shortcode on a post or page with the category “business sector”?
    [show_post_categories show=”category” parent=”no” parentcategory=”business-sector”]

    How is the hierarchy of tour categories?
    Is it like;
    P1
    -c1
    -c2
    P2
    -c3

    Or like
    P1
    -c1
    -p1
    –c1

    Could you point me to a page that is currently using the code?

    • This reply was modified 6 years, 1 month ago by willemso.
    Thread Starter jensrathmann

    (@jensrathmann)

    Hey Wilemso,
    I am sorry I dont understand your first question. My page is:
    https://contacts4pharma.com/companies/baxter_biopharma_solutions/

    I am using a page not a post. As mentioned before, the show=category function is working, but not the filter function for the parents.

    My hierarchy is like your first example? I have 4 parents.
    P1
    -c1
    -c2
    P2
    -c3

    I could give you some pictures if you can tell me your e-mail address.
    Best regards
    Jens

    Plugin Author willemso

    (@willemso)

    Hey Jens,

    sure, contact me here

    In the meanwhile could you remove SPC completely and install the developers edition? Go to the bottom of this page and select “Development version”, download the zip & Upload it to your plugins. Activate it and try again..

    Thread Starter jensrathmann

    (@jensrathmann)

    Hey,
    thanks for helping, I found the problem:

    When I write parentcategory=”services” (Services is a parent category)
    then the childs are displayed. So it works!

    But when I write parentcategory=”business-sector” the childs are not displayed. I think the problem are two words or the combination. So I tried “business_sector”, “businesssector”, but it didnt work. When I renamed “business sector” in “sector” its working. Hhmm ??

    I have one additional question: Do you know how I can set the categories as a list? At the moment:

    Pharma, Biotech,
    Diagnostics

    But it should be:

    Pharma,
    Biotech,
    Diagnostics

    Thanks a lot

    Jens

    Thread Starter jensrathmann

    (@jensrathmann)

    Hello,
    i fixed the problem. You have to write parentcategory=”business sector”. Without – or _. Thank you for your help.
    Could you plese answer my last question:

    I have one additional question: Do you know how I can set the categories as a list?
    https://contacts4pharma.com/companies/baxter_biopharma_solutions/

    Thank you

    Jens

    Plugin Author willemso

    (@willemso)

    Hey Jens

    Thanks for the update about your issue!
    I wil investigate it further and if I can find a reason why this happens I′ll implement a solution.

    About your second question;
    By default the output will be a string. You could add a linebreak as seperator and use some css to create a list when needed.
    If this would not suit your needs I can add an attribute and let PHP output the array into unordered list.. but this will take some time.

    It would look like ;

    <ul>
     <li>Joe</li>
     <li>Jane</li>
     <li>Mike</li>
    </ul>
    Thread Starter jensrathmann

    (@jensrathmann)

    I think this is ok.

    Plugin Author willemso

    (@willemso)

    Hi Jens,

    Ok – I will add it to my todo list.

    In the meanwhile I am marking this topic as solved. If any questions remain just ask!

Viewing 10 replies - 1 through 10 (of 10 total)
  • The topic ‘Show only categories of one parent category.’ is closed to new replies.