Forums

Very unexpected T_STRING error (3 posts)

  1. ianadams
    Member
    Posted 5 years ago #

    So I'm trying to use is_home() in a simple if/then statement, and suddenly I'm getting this error:


    Parse error: parse error, unexpected T_STRING in /home/username/public_html/wordpress/wp-content/themes/awarmgun/structure/primary_navigation.php on line 5

    Here's the contents of primary_navigation.php:


    <dl>
    <dt id="home"<? if(is_home()) echo(" class=\"currentpage\">Home</dt>"); else echo("><a href=\"/\"
    title=\"The front page — where you’ll find the most recently posted stuff\">Home</a></dt>"); ?>
    <dd>The front page — where you’ll find the most recently posted stuff</dd>
    <dt id="archives"<? if(is_page('archives')) echo(" class=\"currentpage\">); ?><a href="/archives/" title="The archives — older articles, listed by date">Archives</a></dt>
    <dd>The archives — older articles, listed by date</dd>
    <dt id="linkblog"<? if(is_page('linkblog')) echo(" class=\"currentpage\">); ?><a href=\"/linkblog/\" title=\"The Link Blog — an (almost) daily list of interesting links\">Link Blog</a></dt>
    <dd>The Link Blog — an (almost) daily list of interesting links</dd>
    </dl>

    I've been wracking my brain trying to figure out what's wrong with it, but as far as I can tell, there's nothing wrong with it at all. Maybe I just need a set of fresh eyes?

    Thanks!

    -ian

  2. moshu
    Member
    Posted 5 years ago #

    I am not a coder by any stretch of imagination... but aren't you missing some important { and } brackets?
    http://codex.wordpress.org/Conditional_Tags

  3. ianadams
    Member
    Posted 5 years ago #

    Well, the brackets you don't always need. I figured it out, though: I was missing some end quotes.

    Thanks for the help, though! :)

Topic Closed

This topic has been closed to new replies.

About this Topic