Home page categories
This support request was posted in Flatbase by webbalda
- webbalda January 6, 2017 at 1:00 am
Hello,
I would like to display certain categories on the homepage.
I’ve tried to put the custom code with
$args[‘category’] = ‘8’; // replace 8 with the id of the category you want
to the theme, from https://gist.github.com/juanfra/9032e2f1aca3d06340c60d69599b6f92
and from here: https://nicethemes.com/forums/topic/documentation-for-nicethemes_knowledgebase-function-arguments/Does not work form me. The home page does not show any categories if the code has
$args[‘category’] = ‘8’; Where 8 is category ID. In my case it is ’33, 34, 35, 36′;
If I replace
$args[‘category’] = ‘8’
with
$args[‘category’] = ‘0’
All categories shows by default.Please let me know what I am missing here.
Thank you
Juanfra Aldasoro January 6, 2017 at 4:44 pmHi,
Thank you for writing. I hope you are doing well.
The code from the gist should do the trick. Where are you putting the code?
Please have in mind that it will take action on the front page only. If you are using the home page template in another page you will need to edit the conditional.
Best,
Juan.webbalda January 8, 2017 at 11:15 pmHi,
I ‘ve tried to use two options:
1) Change template-home.php with ‘category’
——————————–
nicethemes_knowledgebase( array(
‘columns’ => 3,
‘category’ => 33, 34, 35,
‘numberposts’ => $number_articles,
‘before’ => ‘<section id=”knowledgebase” class=”home-block clearfix”><div class=”col-full”>’,
‘after’ => ‘</div></section>’
)
);
———————————2) Use “My custom functions” plugin
——————————–
function nice_knowledgebase_category_home( $args ){
if ( is_home() || is_front_page() ) {
$args[‘category’] = ’33, 34, 35′; // replace 8 with the id of the category you want
}
return $args;
}
add_filter( ‘nicethemes_knowledgebase_default_args’, ‘nice_knowledgebase_category_home’ );
———————————-
I need this update for the front page. All internal pages should stay the same.Thank you
Juanfra Aldasoro January 9, 2017 at 1:23 pmHi,
Thank you for the follow up.
Both changes seem to be correct. What are you getting?
Would you please share your site access details with me in a private message so I can take a look?
Thanks,
Juan.Juanfra Aldasoro January 13, 2017 at 2:00 pmHi,
Thank you for sharing your details with me. Unfortunately it seems that you have certain protection for your wp-login.php and I cannot see the login page, as a result I can not login into the admin.
Would you please check that?
Best,
JuanJuanfra Aldasoro January 17, 2017 at 12:27 amHi,
Thank you for the follow up. Unfortunately I have a dynamic IP, is there any chance you can give me an address I can log in to?
Thanks,
Juan.
You must be logged in to reply to this topic.