• Resolved greentomato

    (@greentomato)


    Hi all,

    I’m modifying the Craving4Green theme, authored by Sadish Balasubramanian, and ran into a setback regarding the sidebar. Here’s the site in progress for your reference.

    The sidebar.php file contains the conditional tag is_home, which I understand (in my limited experience with php) determines that the content it applies to will display ONLY on the home page. What I’d like to accomplish for the sidebar is the opposite of this. Basically, I want all of the sidebar content to be omnipresent – on every page, no matter what. Simply removing all instances of the string:
    <?php if(is_home()) {?>
    from the sidebar.php file does not do the trick – it just errors out thusly:
    Parse error: syntax error, unexpected '}' in /xxxx/.xxxx/xxxx/lunacirclefarm.com/wp-content/themes/Craving4Green/sidebar.php on line 3.

    On a related note, the get_sidebar function call appears within all of the files that it should (index.php, archive.php, page.php, category.php, etc.), and the sidebar content without the conditional tag is_home associated with it DOES load, and looks fine.

    If this is nearly the dumbest newbie question ever, I sincerely apologize in advance. Of course, any help on this topic is appreciated.

    Thank you.

Viewing 2 replies - 1 through 2 (of 2 total)
  • ben-n

    (@ben-n)

    Hi

    I think the problem is your not removing the entire call. your code should look something like this:
    <?php if (is_home()) { ?>
    The stuff that only shows on the home page
    <?php } ?>

    You need to remove the <?php } ?> as well that’s what’s causing the problem.

    Good Luck!
    Ben-N

    Thread Starter greentomato

    (@greentomato)

    Hi Ben-N,

    You’re right! I removed the closing part of the php call, and all is right in the world. My php ignorance was the problem.

    Thanks lots for your kind, swift reply.

    -Green Tomato

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Opposite behavior of is_home conditional tag in sidebar needed’ is closed to new replies.