[Support request] Parent Category

Home Forums Support [Support request] Parent Category

Home Forums Support Parent Category

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #702639
    Mark

    Hello,
    I would like to replace the default category list in posts where all categories are displayed in one line for more separate lists sorted by the parent category. Example

    standard categories list:
    CATEGORIES: ssd, samsung, hdd, seagate, crucial, corsair, western digital

    Parent categories list:
    SSD: samsung, crucial, corsair
    HDD: seagate, western digital

    What is the right hook? Thanks!

    #702709
    Tom
    Lead Developer
    Lead Developer

    Hi there,

    You can filter the current categories like this:

    add_filter( 'generate_category_list_output', function() {
        // Your parent/child category code here.
    } );

    I’m not sure what the code would be to separate your categories like that off hand though. If you’re not sure, it may be worth asking over on https://wordpress.stackexchange.com/.

    Let me know if this helps or not πŸ™‚

    #703581
    Mark

    Hi Tom,

    this is the answer I’ve got πŸ˜€

    “The filter you mention is not standard WordPress but GeneratePress. You’ll have to ask on their forum (or the theme that uses it). – cjbj 4 hours ago”

    #703738
    Tom
    Lead Developer
    Lead Developer

    Yes, the filter itself is a GeneratePress filter.

    However, it just defines where the code within it is placed (like a hook).

    It’s the code inside that we’re interested in. The GeneratePress filter itself can be completely ignored.

Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.