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 »

Category description & category classes


 
Prev Previous Post   Next Post Next
  #1  
Old Mar 19, 2009, 02:52 PM
shedhed's Avatar
shedhed
 
52 posts · Mar 2009
Bramhall, UK
Help Category description & category classes

I'm trying to modify the category horizontal menu to do two things:-

Firstly to incorporate the category description under the actual category. I appreciate that this is available as a "hover" option but I'm trying to show it permanently.

Secondly I'm looking to limit the categories to 5 of my choice through the theme options (done), set them to 20% width (done) and style their colours/hover colours individually. To do this last bit I think I need individual li classes on each category so that I can style them one by one. Only the current li gets a class.

I've mooched about where this code is generated and I think it's in bfa_hor_cats.php - here's an example:-

Code:
$list_cat_string = preg_replace("/<li class=\"(cat-item|cat-item cat-item-[0-9]+)(.*?)\n<ul class='children'>/i","<li class=\"rMenu-expand\\2\n <ul class=\"rMenu-ver\">",$list_cat_string);
Now using shedhed's law of tinkering with code when you have no idea what you're doing I eventually got round to removing the pipe symbol thus:-

Code:
$list_cat_string = preg_replace("/<li class=\"(cat-item cat-item cat-item-[0-9]+)(.*?)\n<ul class='children'>/i","<li class=\"rMenu-expand\\2\n <ul class=\"rMenu-ver\">",$list_cat_string);
This ends up with with the category li's having a class, eg:-

HTML Code:
<li class="cat-item cat-item-13"><a title="blah." href="http://blah/wordpress/category/blah/">Blah blah</a>
</li>
By doing this have I broken something that I don't know about - I'm a complete php novice and lethal with it. If I have is there a way to get classes on each category?

Any help with either of the above gratefully received.

Thanks, Andy
 

Bookmarks



Similar Threads
Thread Thread Starter Forum Replies Last Post
Changing category order in category menu bar, not in sidebar cat. list paulae Page & Category Menu Bars 13 Mar 30, 2011 05:36 PM
Combining Category &amp;amp; Pages menu Masselyn Page & Category Menu Bars 12 Mar 2, 2010 05:07 PM
Category title on category page, not on each post excerpt kicker paulae Excerpts, Read more, Pagination 4 Jun 22, 2009 11:33 AM
TUI's Category Description for Archive Not Working sleizure Plugins & Atahualpa 1 May 29, 2009 02:05 PM
Category & Date archives Cosmic Comix & Toys Forum How-To 1 Mar 8, 2009 05:15 AM


All times are GMT -6. The time now is 12:42 PM.


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