Wordpress Themes - WP Forum at BFA
There will be no more development for Atahualpa (or any other theme), and no support. Also no new registrations. I turned off the donation system. I may turn the forum to read only if it gets abused for spam. Unfortunately I have no time for the forum or the themes. Thanks a lot to the people who helped in all these years, especially Larry and of course: Paul. Take care and stay healthy -- Flynn, Atahualpa developer, Sep 2021

Wordpress Themes - WP Forum at BFA » WordPress Themes » Atahualpa 3 Wordpress theme » Page & Category Menu Bars »

Show empty categories


  #1  
Old Feb 19, 2009, 02:24 PM
olsonsp4c
 
4 posts · Feb 2009
Show empty categories

Hello, this both a tutorial and a feature request to include a little tick box in the Category Bar options that allows you to show empty categories...

Here's how to show empty categories until then

In functions/bfa_hor_cats.php

Find this:

Code:
   $list_cat_string = wp_list_categories('orderby=' . $sort_order . '&title_li=&depth=' . $levels . '&exclude=' . trim(str_replace(" ", "", $exclude)) . '&echo=0');
Replace with this:

Code:
   $list_cat_string = wp_list_categories('hide_empty=0&orderby=' . $sort_order . '&title_li=&depth=' . $levels . '&exclude=' . trim(str_replace(" ", "", $exclude)) . '&echo=0');
Scott
  #2  
Old Apr 20, 2009, 09:38 AM
paul2008
 
6 posts · Apr 2009
For some reason, it doesn't work for me, though I changed that line.
Any ideas why it may not be working?

Thanks
  #3  
Old Apr 22, 2009, 10:41 PM
olsonsp4c
 
4 posts · Feb 2009
in 3.3.2, the structure of the statement was changed...

with the addition, it should now be:

Code:
function bfa_hor_cats($sort_order = "ID", $order = "ASC", $levels = "", $titles = "No", $exclude = "") { 
	$list_cat_string = wp_list_categories('hide_empty=0&orderby=' . $sort_order . '&order=' . $order . '&title_li=&depth=' . $levels . '&exclude=' . trim(str_replace(" ", "", $exclude)) . '&echo=0');
	$list_cat_string = preg_replace("/<li class=\"(.*?)\n<ul class='children'>/i","<li class=\"rMenu-expand \\1\n <ul class=\"rMenu-ver children\">",$list_cat_string);
	$list_cat_string = preg_replace("/<li class=\"(.*?)\n\t<ul class='children'>/i","<li class=\"rMenu-expand \\1\n\t <ul class=\"rMenu-ver children\">",$list_cat_string);
	$list_cat_string = preg_replace("/<li class=\"(.*?)\n\t\t<ul class='children'>/i","<li class=\"rMenu-expand \\1\n\t\t <ul class=\"rMenu-ver children\">",$list_cat_string);
	$list_cat_string = preg_replace("/<li class=\"(.*?)\n\t\t\t<ul class='children'>/i","<li class=\"rMenu-expand \\1\n\t\t\t <ul class=\"rMenu-ver children\">",$list_cat_string);
	$list_cat_string = preg_replace("/<li class=\"(.*?)\n\t\t\t\t<ul class='children'>/i","<li class=\"rMenu-expand \\1\n\t\t\t\t <ul class=\"rMenu-ver children\">",$list_cat_string);
	$list_cat_string = preg_replace("/<li class=\"(.*?)\n\t\t\t\t\t<ul class='children'>/i","<li class=\"rMenu-expand \\1\n\t\t\t\t\t <ul class=\"rMenu-ver children\">",$list_cat_string);
	$list_cat_string = preg_replace("/<li class=\"(.*?)\n\t\t\t\t\t\t<ul class='children'>/i","<li class=\"rMenu-expand \\1\n\t\t\t\t\t\t <ul class=\"rMenu-ver children\">",$list_cat_string);
	$list_cat_string = preg_replace("/<li class=\"(.*?)\n\t\t\t\t\t\t\t<ul class='children'>/i","<li class=\"rMenu-expand \\1\n\t\t\t\t\t\t\t <ul class=\"rMenu-ver children\">",$list_cat_string);
	$list_cat_string = preg_replace("/<li class=\"(.*?)\n\t\t\t\t\t\t\t\t<ul class='children'>/i","<li class=\"rMenu-expand \\1\n\t\t\t\t\t\t\t\t <ul class=\"rMenu-ver children\">",$list_cat_string);
	$list_cat_string = preg_replace("/<li class=\"(.*?)\n\t\t\t\t\t\t\t\t\t<ul class='children'>/i","<li class=\"rMenu-expand \\1\n\t\t\t\t\t\t\t\t\t <ul class=\"rMenu-ver children\">",$list_cat_string);

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
pagination problem - page 2 of categories don't show up! collymore Page & Category Menu Bars 2 May 17, 2009 08:38 AM
disable links in category menu for parent categories (only childless categories link) qcook2000 Page & Category Menu Bars 0 May 15, 2009 09:09 PM
Huge amount of empty space, and YSlow paulae Atahualpa 3 Wordpress theme 3 May 5, 2009 11:06 AM
[SOLVED] Category menu: show empty categories perdox808 Page & Category Menu Bars 2 Apr 8, 2009 09:59 PM
how to show only categories with a high number of posts ? elpidiofilho Atahualpa 3 Wordpress theme 4 Mar 17, 2009 02:43 PM


All times are GMT -6. The time now is 05:53 AM.


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