Welcome to RCT Portal Web design Internet solutions linux
Search
_TOPICS
Home Your Account FAQ Topics Content Submit News Top 10
  Login/Create an Account    

Modules
· Home
· Downloads
· Feedback
· Forums
· Private Messages
· Recommend Us
· Search
· Statistics
· Stories Archive
· Submit News
· Surveys
· Top 10
· Topics
· Web Links
· Your Account

Who's Online
There are currently, 7 guest(s) and 2 member(s) that are online.

You are Anonymous user. You can register for free by clicking here

Old Articles
Thursday, September 06
· Changing the date and time on linux box
Wednesday, September 05
· Thunderbird is already running...
Sunday, September 02
· Anti spam for exchange 2003
· PSCP the putty secure copy
· things you need to knwo before Buying a domain name
Saturday, September 01
· NVU The open source HTML Development platform
· Nagios monitoring system
Thursday, August 30
· Google Preview
Wednesday, August 29
· Ethereal - A network sniffer
· Live HTTP headers plugin for firefox
· Web application security with paros
· DDOS attacks and BGP
· Monitor network performance and more
Tuesday, August 28
· Perl modules installation
· Finjan Safe Browsing
· Screen saver defragmentation
Monday, August 27
· VI M Text editor
· AnalogX
· Security focus
Thursday, October 22
· */ ?>

Google search
There is a problem right now with this block.

ads
There is a problem right now with this block.

Wordpress Show subcategories only under current category
Posted on Thursday, May 21 @ 13:52:18 IDT by theog

Wordpress I have busted my brains out to find out how to show subcategories only under the current category in wordpress.
mainly there are a lot of plugins who do that, but I had a couple of problems:
1. I was working with the a different language than english - and RTL (hebrew)
2. I was working with a custome design I have made which had some changes to the classes.php file.

I have managed to perform this using a simple elseif:



in the wp-cinludes/classes.php file change:

                $top_level_elements = array();
                $children_elements  = array();
                foreach ( $elements as $e) {
                        if ( 0 == $e->$parent_field )
                                $top_level_elements[] = $e;
                        else
                                $children_elements[ $e->$parent_field ][] = $e;
                }



into:
               $top_level_elements = array();
                $children_elements  = array();
                foreach ( $elements as $e) {
                        if ( 0 == $e->$parent_field )
                                $top_level_elements[] = $e;
                        elseif ($e->$parent_field == $_GET['cat'])
                                $children_elements[ $e->$parent_field ][] = $e;
                }



notice the "else" is changed to:
elseif ($e->$parent_field == $_GET['cat'])

good luck!

 
Login
Nickname

Password

Don't have an account yet? You can create one. As a registered user you have some advantages like theme manager, comments configuration and post comments with your name.

Related Links
· More about Wordpress
· News by theog


Most read story about Wordpress:
wordpress categories vanish suddenly


Article Rating
Average Score: 0
Votes: 0

Please take a second and vote for this article:

Excellent
Very Good
Good
Regular
Bad


Options

 Printer Friendly Printer Friendly



RCT web design and internet solutions
RCT web development
Page Generation: 0.15 Seconds