WordPress.org

Ready to get started?Download WordPress

Forums

Need help in manipulating list category tag (5 posts)

  1. Deep
    Member
    Posted 7 years ago #

    Hi,
    I am trying to manipulate wp_list_categories so that I can get the output like following html code:

    <h2><a href="#" onclick="Effect.toggle('cat_id','blind'); return false">Cat Name</a></h2>
                    <ul id="cat_id">
                    	<li><a href="#">Sub Cat1</a></li>
                        <li><a href="#">Sub Cat 2</a></li>
                        <li><a href="#">Sub Cat 3</a></li>
                        <li><a href="#">Sub Cat 4</a></li>
                    </ul>

    Any ideas how to do it?

    Deep

  2. Deep
    Member
    Posted 7 years ago #

    no one knows?

  3. Deep
    Member
    Posted 7 years ago #

    sorry for bumping the topic but just giving it a last try..

  4. kristarella
    Member
    Posted 7 years ago #

    I think you just want to insert that code into your sidebar, replacing the <li> parts with the wp_list_cats tag.
    The onclick stuff is a javascript command. I assume you've directed to the approriate javascript somewhere in your code? (I hope so anyway because I suck at javascript!)

  5. Deep
    Member
    Posted 7 years ago #

    Actually I am using prototype library to have a collapsible menu for sidebar. And I also do not want to provide the link to main category (will keep it # or something)

    In short, I am looking for some way to get the raw data somehow so I can play around with it and have it in my own way.

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags