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); 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); HTML Code:
<li class="cat-item cat-item-13"><a title="blah." href="http://blah/wordpress/category/blah/">Blah blah</a> Any help with either of the above gratefully received. Thanks, Andy |
What you did will be the standard from version 3.2.1 on - I am adding back all extra classes that Wordpress adds throughout a site, and even add some more
I had removed some of the default classes/IDs as they weren't used by Atahualpa but I realized that having classes and an ID on just about any element easily outweighs the disadvantage of a more cluttered code |
Flynn,
Thanks for your reply - appreciated. Having all those classes available in the next issue will be good news. Do you have any guidance on how to add the category description to the horizontal category menu bar? I'm trying to get the description to appear beneath its menu item permanently rather than rely on the hover. Thanks in advance, Andy |
In functions/bfa_hor_cats.php change
PHP Code:
PHP Code:
HTML Code:
span.cat-descr { if you haven't set a description for a category (at Site Admin -> Categories -> Edit -> Description) then the text will be "View all posts filed under [Category Name]". To show the description only if a description was set, and otherwise display nothing instead of "View all posts....", replace the last part in the code above, this one PHP Code:
PHP Code:
|
Flynn,
Brilliant - exactly what I was after. Thank you. Andy |
All times are GMT -6. The time now is 02:58 PM. |
Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.