This topic has 15 replies, 3 voices, and was last updated 9 years by Radu.

  • Author
  • #56116
     Gandam
    Participant

    Hi,
    I haven been creating different category pages and I was thinking if you could help me to avoid the specific category/tag displaying on default blog page, so it doesn’t repeatedly show in default blog page. In any new page I can manage to set up a different “data source” to narrow its displaying on frontend, but not for default blog page, so how do I do it?! I can’t find any similar topics from your support. Thank you for providing us excellent support always.

    #56247
     Radu
    Moderator

    Hello,

    1. Activate Kleo Child Theme.

    2. Then replace index.php from child theme with this file ( see attachment ).

    3. Open the index.php look for $hidecategories = ‘cat=-1,-2,-3’; ( line 26 )

    Replace -1 with id from category do you want to hide if you want to hide only one category the code will be like this : $hidecategories = ‘cat=-1’; but if you have more than one category to hide code will be like this : $hidecategories = ‘cat=-1,-2,-3’;

    Let me know if it works.

    Cheers

    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution
    Attachments:
    You must be logged in to view attached files.
    #56282
     Gandam
    Participant

    @Radu – thanks for your help. I am not sure if I am doing this right, but nothing has changed after I replaced index file and amended this line to $hidecategories = ‘cat=-events′; is category id same as category name? Pls advise, thanks again.

    #56283
     Gandam
    Participant

    @Radu – I’ve managed to get category id, it works!! great help, thanks!!:)

    #56542
     Gandam
    Participant

    @Radu – I picked up another error after I replaced attached index.php file. It seems that this index.php breaking up blog pagination, what do I do now, pls help?! 🙁

    #56584
     Radu
    Moderator

    HEllo,

    Please give me the url, and the admin credentials.

    I need to take a look closer.

    Cheers

    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution
    #56588
     Gandam
    Participant
    This reply has been set as private.
    #56623
     Radu
    Moderator

    Hello,

    I added in your kelo-child/functions.php this function that will exclude certain categories.

    COPY CODE
    
    function exclude_category_home( $query ) {
        if ( $query->is_home() && $query->is_main_query() ) {
            $query->set( 'cat', '-2,-80' );
        }
    }
    add_action( 'pre_get_posts', 'exclude_category_home' );
    

    If you want to add more categories, just separate them with commas.

    Let me know if is ok.

    Cheers

    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution
    #56628
     Radu
    Moderator

    A small thing, just re assign a blog page from Settings -> Readings -> Front page displays -> Posts page.

    Cheers

    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution
    #56635
     Gandam
    Participant

    @Radu – Everything seems to be in working order, pagination is working as well, thank you so much!! 🙂

    #71017
     clickafy
    Participant

    I was able to make the change…

    But it’s not paginating correctly… it just respawns the blog posts every time…every page.

    brandmediastudio.com – click on articles… to see.

    Thoughts?

    #71073
     Radu
    Moderator
    #71263
     clickafy
    Participant
    This reply has been set as private.
    #71305
     Radu
    Moderator

    Try to apply only the second solution, it this doesn’t work please provide admin credentials to look closer.

    Regards

    RAdu

    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution
    #71388
     clickafy
    Participant

    That seems to have fixed it… thanks. 🙂

    #71409
     Radu
    Moderator

    You’re welcome,

    Also don’t forget to rate our theme on Themeforest and give it 5 stars 🙂

    http://themeforest.net/downloads/

    Best regards

    Radu

    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution
Viewing 16 posts - 1 through 16 (of 16 total)

The forum ‘KLEO’ is closed to new topics and replies.

Log in with your credentials

Forgot your details?