• Resolved nhuanh

    (@nhuanh)


    hello
    i having a newsite http://thoitrangaodoi.com
    Now I want have a new item in menu on my site ( Tin Tức) and content in that item ( Tin Tức)doesn’t display on hompage
    can u help me, sorry if i writting E wrong

Viewing 4 replies - 1 through 4 (of 4 total)
  • MJ

    (@mardie)

    Are you using wordpress menus? Login to wordpress, go to appearance > menu.. If you don’t have this, then try using this plugin:
    http://wordpress.org/extend/plugins/exclude-pages/

    Muhammad Haroon

    (@muhammadharoon)

    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');

    Muhammad Haroon

    (@muhammadharoon)

    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.