NiceThemesExcluding Categories from Blog Roll – NiceThemes http://nicethemeswp.com/forums/topic/excluding-categories-from-blog-roll/feed/ Wed, 23 Apr 2025 14:46:40 +0000 http://bbpress.org/?v=2.5.12-6148 en-US http://nicethemeswp.com/forums/topic/excluding-categories-from-blog-roll/#post-3634 <![CDATA[Excluding Categories from Blog Roll]]> http://nicethemeswp.com/forums/topic/excluding-categories-from-blog-roll/#post-3634 Tue, 11 Mar 2014 22:54:26 +0000 JayWilly Hello NiceThemes!

I’ve purchased and installed your theme and am almost done my site. One of the last things I need to do is exclude two categories of posts from displaying on the Blog page.

Could you please provide me with the technical answer / snippet of code?

Really looking forward to hearing from you soon!

I’m almost there!

Thanks

Justin

]]>
http://nicethemeswp.com/forums/topic/excluding-categories-from-blog-roll/#post-3639 <![CDATA[Reply To: Excluding Categories from Blog Roll]]> http://nicethemeswp.com/forums/topic/excluding-categories-from-blog-roll/#post-3639 Wed, 12 Mar 2014 00:36:45 +0000 Juanfra Aldasoro Hi Justin,

Thanks for writing.

Unfortunately we can’t provide support on customization. However, I’ve posted something related to that in my personal blog a while ago: http://juanfra.me/2012/11/how-to-exclude-categories-from-your-wordpress-home-page/

You should use that snippet and modify the is_home conditional

Best,
Juan

]]>
http://nicethemeswp.com/forums/topic/excluding-categories-from-blog-roll/#post-3642 <![CDATA[Reply To: Excluding Categories from Blog Roll]]> http://nicethemeswp.com/forums/topic/excluding-categories-from-blog-roll/#post-3642 Wed, 12 Mar 2014 00:53:25 +0000 JayWilly Thanks for the quick reply. Do you offer your services for sale to customize?

Looking at that snippet, it is a little outside my scope, as I don’t eally work with .php

Trying to wrap my head around that conditional statement.

]]>
http://nicethemeswp.com/forums/topic/excluding-categories-from-blog-roll/#post-3643 <![CDATA[Reply To: Excluding Categories from Blog Roll]]> http://nicethemeswp.com/forums/topic/excluding-categories-from-blog-roll/#post-3643 Wed, 12 Mar 2014 01:01:51 +0000 Juanfra Aldasoro No problem.

Unfortunately we don’t offer customization services. You can contact our friends at http://codeable.io

Best,
Juan.

]]>
http://nicethemeswp.com/forums/topic/excluding-categories-from-blog-roll/#post-3644 <![CDATA[Reply To: Excluding Categories from Blog Roll]]> http://nicethemeswp.com/forums/topic/excluding-categories-from-blog-roll/#post-3644 Wed, 12 Mar 2014 01:04:34 +0000 JayWilly Aaaaand my site has a white out…

#crappy

]]>
http://nicethemeswp.com/forums/topic/excluding-categories-from-blog-roll/#post-3645 <![CDATA[Reply To: Excluding Categories from Blog Roll]]> http://nicethemeswp.com/forums/topic/excluding-categories-from-blog-roll/#post-3645 Wed, 12 Mar 2014 01:18:51 +0000 Juanfra Aldasoro Hello Justin,

Would you please describe me what is that you have done?

Best,
Juan.

]]>
http://nicethemeswp.com/forums/topic/excluding-categories-from-blog-roll/#post-3646 <![CDATA[Reply To: Excluding Categories from Blog Roll]]> http://nicethemeswp.com/forums/topic/excluding-categories-from-blog-roll/#post-3646 Wed, 12 Mar 2014 01:25:16 +0000 JayWilly What I did was copy and paste this code.

is_home() && $query->is_main_query() )
$query->set( ‘cat’, ‘-1,-2,-3’ );

return $query;
}

add_filter( ‘pre_get_posts’, ‘nice_exclude_cat’ );

?>

and changed

is_home -> is_blog

( ‘cat’, ‘-1,-2,-3’ ); -> ( ‘cat’, ‘6,7’ );

That is all.

Thank you for showing interest in my dilemma… 🙂

]]>
http://nicethemeswp.com/forums/topic/excluding-categories-from-blog-roll/#post-3647 <![CDATA[Reply To: Excluding Categories from Blog Roll]]> http://nicethemeswp.com/forums/topic/excluding-categories-from-blog-roll/#post-3647 Wed, 12 Mar 2014 01:29:18 +0000 Juanfra Aldasoro Hello Justin,

First of all, you have erased the function definition. This is, where the function nice_exclude_cat is defined.

Secondly, the function is_blog doesn’t exist. You should review your code and take into account that a simple comma or error in any piece of code can make your screen white.

Best,
Juan.

]]>
http://nicethemeswp.com/forums/topic/excluding-categories-from-blog-roll/#post-3648 <![CDATA[Reply To: Excluding Categories from Blog Roll]]> http://nicethemeswp.com/forums/topic/excluding-categories-from-blog-roll/#post-3648 Wed, 12 Mar 2014 01:42:39 +0000 JayWilly My apologies.

This was the code that I used.

is_home() && $query->is_main_query() )
$query->set( ‘cat’, ‘-1,-2,-3’ );

return $query;
}

add_filter( ‘pre_get_posts’, ‘nice_exclude_cat’ );

?>

———-

Anyway, I’ve handed it over to a .php dev – so it shall be fixed real soon.

FTP file reset lol!

Thanks Juan

]]>
http://nicethemeswp.com/forums/topic/excluding-categories-from-blog-roll/#post-3649 <![CDATA[Reply To: Excluding Categories from Blog Roll]]> http://nicethemeswp.com/forums/topic/excluding-categories-from-blog-roll/#post-3649 Wed, 12 Mar 2014 01:43:38 +0000 JayWilly For some reason <?php is not appearing in the message reply.

]]>