• Resolved awholelotofnothing

    (@awholelotofnothing)


    I’m having luck with the shortcode displaying the correct categories but despite indicting “no” for displaying parent categories, the plugin is displaying them as well.

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

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

    (@willemso)

    Hi

    Thanks for using Show Post Categories.

    I have seen the issue on the provided link (Genre), it’s no normal behavior.
    Could you tell me what shortcode is used? Also, is this a custom object or rather a default WordPress Category?

    The following shortcode should work just fine;
    [show_post_categories show=”category” parent=”no” separator=”| “]

    Also, do you experience this on the default theme too? Or only on the current one?

    Please provide me with feedback so we can resolve your issue ??

    Thread Starter awholelotofnothing

    (@awholelotofnothing)

    Thanks for your reply!

    I’m using the following shortcode:

    [show_post_categories show=”category” parentcategory=”Genre” parent=”no” hyperlink=”yes”]

    Plugin Author willemso

    (@willemso)

    Hello,

    Thanks for providing the code.
    I simulated your use case and detected what goes wrong.

    If I am right, you are using the following hierarchy;
    Books
    – Genre
    – – Erotica
    – – Modern Romance

    In this case your Parent Cat. is “Books”, not “Genre”. I totally understand your way of thinking that “Genre” is a Parent. And in some way that is true, but strictly speaking it is not ??

    I quickly researched WP′s way of working on this subject and from a code perspective there is nothing really wrong. That said, I think I could filter out your “second” Parent. But this will take some time as I would need to assess the impact on other users..

    For a short term workaround I would say move them one level down, if that is an option?

    Thread Starter awholelotofnothing

    (@awholelotofnothing)

    I updated the code with the parent category to be Books, and it just pulls all of the categories instead of the subcategories.
    [show_post_categories show=”category” parentcategory=”Books” parent=”no” hyperlink=”yes”]

    I think you can see from the page how I’m trying to pull the subcategories (Genre, Heat Rating, Series) for each book, not just a list of all the categories. Any help there?
    https://5f0.b06.myftpupload.com/2018/01/02/template/

    Plugin Author willemso

    (@willemso)

    Hi there,

    changing the shortcode will not make any difference. Only changing you category hierarchy would do the trick.

    Anyways, I am looking at the code that needs to be changed. I′ll implement a solution and publish a new version, but this will take some time. For now I can offer you the following solution;

    In the WordPress “Dashboard” go to: “Plugins” – “Editor“.
    A prompt will show up, read it and continue.
    in the “Edit Plugins” menu, on the right side, there is an option: “Select plugin to edit“. Select the plugin “Show Post Categories” & push “select“.
    On the right side select “includes” – “core.php“.
    Your page will refresh and line 3 wil show “File: core.php”

    Now, go to line 170, it shows:
    if($category->parent != 0 ){
    change it to;
    if($category->parent != 0 && $category->term_id != $parentcat ){

    be careful not to change anything else. If you do my plugin will not work and you will need to reinstall it to get it working again.

    Now, confirm the change by selecting “update file” at the bottom.

    If all goes well, you will not see a message like “Unable to communicate back with site to check for fatal errors..” If it does you will need to change the config using FTP.

    Once completed it will no longer show “genre”.

    Please try this solution and let me know if it helped.

    Plugin Author willemso

    (@willemso)

    Hi

    I’m closing this request because it’s been close to two weeks without feedback.
    If your problem is still there contact me here

    I will release a new version soon. One with the above code included.

    Plugin Author willemso

    (@willemso)

    fyi – just released 2.2.33
    this will no longer show those nested parents

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Parent Category Displaying Despite “no”’ is closed to new replies.