Viewing 4 replies - 1 through 4 (of 4 total)
  • Are you using wordpress menus? Login to wordpress, go to appearance > menu.. If you don’t have this, then try using this plugin:
    https://www.ads-software.com/extend/plugins/exclude-pages/

    I can’t get you properly but you can use conditional tags to apply a condition about where do you want your content to be displayed like following code will only show your content in posts and pages:

    function content( $content ) {
    if(is_single() | is_page()) {
     return $content . Your content;
    
    } else {
    return $content;
    }
    
    add_filter('the_content', 'content');

    It’s an example about how you can use if else conditions it’s not a proper code because I didn’t get you exactly which content you want to display on home and which you want to exclude from homepage… ??

    Thread Starter nhuanh

    (@nhuanh)

    ok, final i can do it. I wirte code in my funtion.php
    Funtions.php

    function exclude_category_home( $query ) {
    if ( $query->is_home ) {
    $query->set( ‘cat’, ‘-9 );
    // -9 is my ID Catalogie i want to hide content at homepage
    }
    return $query;
    }

    add_filter( ‘pre_get_posts’, ‘exclude_category_home’ );
    thanks all! regard

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘I don't want content display on hompage???’ is closed to new replies.