Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Contributor Richard Archambault

    (@richardmtl)

    Hi skiabox,

    I believe there’s a way to do this, but I’ve asked for help from the Jetpack developers to make sure I have the correct way of doing it. I’ll get back to you soon!

    Thread Starter skiabox

    (@skiabox)

    Ok, thank you very much for answering!

    Plugin Contributor Richard Archambault

    (@richardmtl)

    Hi, have a look at this post:

    https://jetpack.me/2014/02/26/exclude-a-category-from-mobile-theme/

    That should do it for you! Let me know if you need any help with it.

    Hello,
    I I’m using JetPack 3.0.2 and WordPress 3.9.1. I have a custom functions.php file in my child theme.

    I’m trying to exclude a category from my JetPack Mobile theme and it seems to ignore the code found here:
    https://jetpack.me/2014/02/26/exclude-a-category-from-mobile-theme/

    I have replaced the “-1” with my desired category (-171) but the posts in that category still show.

    I’m using the following code in my functions.php to exclude category 171 for the non-mobile theme with no problems:

    function my_exclude_category( $query ) {
    
      if ( $query->is_home ) {
    		$query->set( 'cat', '-171' );
    	}
    
    	return $query;
    }
    add_filter( 'pre_get_posts', 'my_exclude_category' );

    I also tried removing all other functions from the functions.php file to make sure nothing was interfering, but that still didn’t work.

    Any ideas what could be causing the problem?
    Thanks!

    Disregard… Started a new thread with my issue. (Sorry!)

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘How to restrict post categories from front page’ is closed to new replies.