WordPress.org

Ready to get started?Download WordPress

Forums

Only list one category? (10 posts)

  1. altacivil
    Member
    Posted 8 years ago #

    Is it possible to use a function like wp_list_cat() and ask it to only display one category? I know I can do it by excluding the others I do not want to display... but say I am adding/removing categories, this would mean that I would then have to go into the code and manually change this exclusion every time I changed the structure of my categories.

    Is it possible to, instead of asking it to exclude a certain category(ies) include certain a categoy(ies)??

    Thanks!

  2. Beel
    Member
    Posted 8 years ago #

    If you only want to display one category, why the heck use a tag, just hard code it.

  3. altacivil
    Member
    Posted 8 years ago #

    that sounds like a great idea... only could you be a little more specific... maybe point me in a direction that would help me out a bit more? (ie. How would I do that?)

  4. chaaban
    Member
    Posted 8 years ago #

    he mean just type the html code of the category directly in the php code page

    instead of wp_list_cat() ... put your link <a href ..

  5. altacivil
    Member
    Posted 8 years ago #

    Yes, I understood that bit... I am aware of how to create a link... I suppose what I should have wrote was how do I call up just that one category? Would a link to it just be http://mysite.com/wp/categorynamegoeshere? Or is there a way to say ?

    Thanks for the help so far!

  6. altacivil
    Member
    Posted 8 years ago #

    sorry that "?" should be

    thanks!

  7. altacivil
    Member
    Posted 8 years ago #

    ahh apparently I am just being a noob... it should say [a href=php stuff to call that one specific category]

    Sorry for the numerous postings...

  8. moshu
    Member
    Posted 8 years ago #

    Edit. Misread.

  9. mozey
    Member
    Posted 8 years ago #

    well, actually, i would want to use wp_list_cat to display categories which i want to keep dynamic. So hard coding it would make everything WeIrD. And i'm trying to keep it real. SO i would need something like,

    wp_list_cat($This_category, $That_category)

    something tells me i can just put the id's in there. let me know yo.

  10. mozey
    Member
    Posted 8 years ago #

    actually, i got it!,

Topic Closed

This topic has been closed to new replies.

About this Topic