Documentation for nicethemes_knowledgebase() function arguments
This support request was posted in Flatbase by tondeuse
- tondeuse July 8, 2016 at 2:44 pm
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 July 8, 2016 at 3:12 pmHi 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.tondeuse July 8, 2016 at 7:46 pmHello 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 July 8, 2016 at 8:51 pmHi 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.
You must be logged in to reply to this topic.