Home page categories

This support request was posted in Flatbase by webbalda

Request ID #30707 In Progress
  • 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

    Hi,

    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.

    Hi,

    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

    Hi,

    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.

    This reply has been marked as private.
    Juanfra Aldasoro

    Hi,

    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,
    Juan

    This reply has been marked as private.

    Hi,

    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.

Viewing 8 posts - 1 through 8 (of 8 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