Wordpress Themes - WP Forum at BFA

Wordpress Themes - WP Forum at BFA (http://forum.bytesforall.com/index.php)
-   Center area post/pages (http://forum.bytesforall.com/forumdisplay.php?f=32)
-   -   How to hide one specific category from posts page? (http://forum.bytesforall.com/showthread.php?t=7411)

unelma Jun 3, 2010 07:52 AM

How to hide one specific category from posts page?
 
Hi,

I want to hide category "news" from posts page.

News canīt be displayed in center column or in sidebar.

How I can hide category?

I am using:

Atahualpa 3.4.9
WordPress 2.9.2

Plugins:
Blog in Blog
Widget Logic

sradhey Dec 9, 2010 10:31 AM

Were you able to get a reply to this, i am looking for the solutoin too !!

paulae Dec 9, 2010 12:12 PM

In ATO/Style and Edit Center Column/Content Above the Loop, I entered:
Code:

<?php if (is_front_page() && !is_paged() )
    $posts = query_posts($query_string . '&cat=-15,-80'); ?>

This prevents posts from categories 15 and 80 from appearing in the list of front page posts in the center column.

Then I use the Enhanced Recent Posts plugin multiple times as a sidebar widget, to display a certain number of posts from several categories that I do want to show up in the sidebar. Another plugin, Widget Logic, directs which pages these widgets show up on.

bytpep May 22, 2011 01:49 PM

Thanks paulae for the php code and the offered plugins.

juanma Jun 3, 2011 11:12 AM

Hi, I also want to do something like this but I don't know how. I want some categories to appear only as search results. In other words, I don't want some categories to constantly appear in the front-page, but to appear in the front-page only when they are search results.

paulae Jun 3, 2011 01:39 PM

The Widget Context plugin should help you do that: http://wordpress.org/extend/plugins/widget-context/

juanma Jun 3, 2011 02:55 PM

But Widget Context is for Widgets... I don't have problems with Widgets. My problem is with categories... I don't want some of them to appear in the front page unless someone searches for them and appear as a search result.

paulae Jun 3, 2011 05:42 PM

Ah. Sorry. Didn't read it carefully. So you do need the PHP insert as suggested above, but I think Flynn is not able in the new version of Atahualpa to let you just pop it into the center column above the loop as a theme option. You'll have to modify index.php, I think.

juanma Jun 3, 2011 06:36 PM

I tried inserting that PHP. The problem of this solution is that the chosen categories NEVER appear in the front page. That's not exactly what I'm looking for. I want some categories not to appear in the front page, except when they are search results (e.g. if you enter to the site, you want see them in the front page, but if you use the search tool, I want them to appear as a search result). Any ideas on how I can achieve that?

juggledad Jun 4, 2011 03:56 AM

You will need to edit index.php and play with what paulae suggested, using the php statement
HTML Code:

<?php if (is_front_page() && !is_paged() )
    $posts = query_posts($query_string . '&cat=-15,-80'); ?>


juanma Jun 4, 2011 09:49 AM

What do I have to add to that code to have the excluded categories appearing in the front page as search results? I'm newbie with codes! =(

sanguango Jun 7, 2011 06:08 PM

Hello, I also want to do this and I have the same problem than juanma. Paulae's code didn't work. I also tried installing some plugins (such as, simply exclude) to exclude the category from the front page, but then the category is not shown when you search for it. I'm using the WP Custom Fields Search plugin as search tool. Could that be the problem? juggledad, what do you mean by playing with what paulae suggested? Thanks to both!

sanguango Jun 9, 2011 09:36 AM

Some help with this please?

sanguango Jun 21, 2011 08:27 AM

Hi guys, I still have this problem and I don't know how to resolve it. I've been looking on the forum and the Internet, I've tried different plugins, but I can't find the answer... Could anyone please give me a hand with this?

juggledad Jun 21, 2011 09:13 AM

sanguango - You haven't provided enough information to give you any help
What version of Atahualpa and WP?
What is the URL?
Do you have all BUGFIX's for your version applied? (they can be found in the 'New Version & Updates' forum and sub forum)
--if not, apply them before we go any further and re-test

JimTrail Jun 26, 2011 08:57 PM

Thanks Paulae;

The solution works fine for my web site. It excludes posts in the "Lifestyle ->> Advice" Sections/categories from the front page.

Check it out and see: http://www.iknx.us/

Just a note to the others - you have got to make sure and put Paulae's code above the Loop.

http://codex.wordpress.org/The_Loop

The loop is found in the Atahualpa theme index.php file (not the WordPress index.php found in your root directory).

You can find it here:
/your site/wp-content/themes/atahualpa/index.php

JimTrail Jun 30, 2011 09:28 PM

Quote:

Originally Posted by STB (Post 68886)
Paulae's suggestion stopped working in Ata 3.7

Exactly. In recent versions of Atahualpa you can't insert PHP code in the ATO --> Style & Edit Center Column.

I forgot to mention in my previous post that rather than making the changes in the Style & Edit Center Column section that the changes must be made in the Atahualpa index.php file which resides on the server.

JimTrail Jul 14, 2011 09:05 AM

I found yet another solution to exclude posts from the front page that I thought ATO users might like to know about. It is the "Simply Exclude" plugin.

http://wordpress.org/extend/plugins/simply-exclude/

I have installed it on my web site. It seems to work pretty good.

I am using the following:

WordPress 3.1.2
Atahualpa 3.6.7
PHP Version 5.2.17

I just installed it yesterday so I am still learning about it. I am just excluding one category.

The plugin also excludes the excluded category from the Recent Posts widget. It also appears to exclude the excluded category from the Older Entries page.

longnha Feb 9, 2012 04:55 PM

Quote:

Originally Posted by JimTrail (Post 69545)
I found yet another solution to exclude posts from the front page that I thought ATO users might like to know about. It is the "Simply Exclude" plugin.

http://wordpress.org/extend/plugins/simply-exclude/

I have installed it on my web site. It seems to work pretty good.

I am using the following:

WordPress 3.1.2
Atahualpa 3.6.7
PHP Version 5.2.17

I just installed it yesterday so I am still learning about it. I am just excluding one category.

The plugin also excludes the excluded category from the Recent Posts widget. It also appears to exclude the excluded category from the Older Entries page.

Thank you for the plugin suggestion, it work great on Atahualpa 3.7.3.

Here is the site that I exclude "Promotion" from homepage: http://digitalcashpalace.com/

I came across many thread but this is the only one working, thank you very much. :)


All times are GMT -6. The time now is 11:43 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.