WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Conditional Tag, Outside Loop? (4 posts)

  1. justbishop
    Member
    Posted 3 years ago #

    Wondering if there's a way to tell my header nav:

    "if a tag with slug 'xyz' exists on this blog, spit out this html: <li>http://www.mysite.com/tag/xyz/</li>"

    Is this possible?

  2. lindsayanng
    Member
    Posted 3 years ago #

    I am pretty sure that conditional tags work the same inside the header.php file as they would in the index.php or loop pages

    According to the codex you can use conditional tags in the header, if you use them in the footer you need to reset first then use them

  3. justbishop
    Member
    Posted 3 years ago #

    Thanks :)

    I'm having trouble wrapping my brain around the actual code that would do the conditional for if a tag slug exists or not. Can anyone point me in the right direction on that part?

  4. justbishop
    Member
    Posted 3 years ago #

    Ok, nevermind everyone! I decided to just widgetize my header navigation area and through the wonders of the WP 3.0 custom menu system, create a custom header nav menu and drag the widget to the newly widgetized header. Worked like a charm!!!

    If anyone else is interested in doing something similar, this was an awesome tut:

    http://www.themelab.com/2008/04/18/see-how-easy-it-is-to-widgetize-wordpress-themes/

Topic Closed

This topic has been closed to new replies.

About this Topic