Documentation for nicethemes_knowledgebase() function arguments

This support request was posted in Flatbase by tondeuse

Request ID #7207 In Progress
  • I would like to know if it is possible to force the nicethemes_knowledgebase() function, when called from a home page template, to display the articles nested under child categories.

    There si clearly code in that function that makes the display of subcategories possible, the information I need is how to call the function so that section of the code dealing with contents tagged with subcategories is invoked within the function.

    How should the $args[‘parents’] and $args[‘child_of’] arguments be used?

    Best regards, thank you so much for your time.

    Martin

    Juanfra Aldasoro

    Hi Martin,

    Thank you for writing. I hope you are doing well.

    If I’m understanding correctly, you want to display the categories child of a certain category on your home page.

    To achieve this, you have two options: you can do it via hook or by overriding the template-home.php file in your child theme.

    The name of the parameter is “category”.

    1) If you do it via hook, you need to include some function like the one I’m linking in your functions.php file: https://gist.github.com/juanfra/9032e2f1aca3d06340c60d69599b6f92

    2) If you’re overriding the template in your child theme you will need to copy and paste the original file and for the knowledge base call, you have to add the “category” parameter.

    
    
    nicethemes_knowledgebase( array(
    							'columns'     => 3,
    							'category'     => 8, // 8 will be the ID of your category
    							'numberposts' => $number_articles,
    							'before'      => '
    ', 'after' => '
    ' ) );

    Best,
    Juan.

    Hello Juan,

    Thank you so much for your suggestions, I have resolved under the following ticket, so I think we can close this one : http://nicethemes.com/forums/topic/knowledgebase-function-how-to-list-subcategory-items-on-home-page-using-template

    See also my resolution in a gist :

    Best,

    Martin

    Juanfra Aldasoro

    Hi Martin,

    Thank you very much for your response.

    I’ve reviewed the other support ticket and I’ve also replied over there.

    Have a good weekend,
    Juan.

Viewing 4 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic.

Login to your Account

Welcome back! Please log in to your account by filling the fields below:

Forgot?

Not a member? Create a free account.

Create a Free Account

You're 27 seconds away from some awesome WordPress free stuff, benefits and more. Create a free account and have access to our free products, benefits and more!

Already have an account? Log in
Secure Server