Tutorials

  • aim
  • bebo
  • blogger
  • Del.ici.ous
  • DiggIt
  • Facebook
  • friendfeed
  • Google Bookmarks
  • linkedin
  • Mixx
  • MySpace
  • netvibes
  • Newsvine
  • Google
  • StumbleUpon
  • Technorati
  • tumblr
  • Twitter
  • Andy Sharman's Joomla Sociable Module
  • wordpress
  • Yahoo
  • yahoobuzz


Home / PHP / Wordpress display/hide child LI tags on menu with PHP

Wordpress display/hide child LI tags on menu with PHP

Although I didn't make this code I still feel it needs to be in the knowledge base area rather than the links section as it needs to be available to search the site for it, anyway I was basicallly finding it quite hard to find a wordpress plugin which allows the LI/UL tags to automatically hide depending on wether their parent element is selected or not, kind of like an accordion effect but without the javascript.

Anyway I came across THIS plugin which is very simple and easy to use.

 

I use this code to make it apply the hiding unless the parent is selected:

 

1
2
3
4

wswwpx_fold_page_list ('sort_column=menu_order&title_li='.
'&exclude=5,134,441,439,435,437,443,563,566,715', TRUE);
?>

 

 

I've attached a zip of the file should the actual website ever go down for whatever reason.

Attachments:
FileFile size
Download this file (fold_page_list.php.zip)Wordpress show/hide menu LI tags5 Kb

Add comment


Security code
Refresh

 

 


 

All content is copyrighted to udjamaflip.com 2009-2010, All rights reserved.