• Hello. I’m having trouble with the following code:

    <?php
    // Checks to see whether it needs a sidebar or not. If not, post a search box
    if ( empty($withcomments) && !is_single() ) { echo '<div id="footer">';
    else get_search_form && echo '<div id="footer">';} ?>

    It’s goal:
    If there is a sidebar, just post div#footer
    If there isn’t, post a search box right before posting div#footer

    Help would be greatly appreciated 🙂 Thanks

Viewing 2 replies - 1 through 2 (of 2 total)
  • Your code is missing an closing and opening brace, and the two statements in the second part were started incorrectly. Just moving it around a little:

    <?php
    // Checks to see whether it needs a sidebar or not. If not, post a search box
    if ( empty($withcomments) && !is_single() ) {
    //
    } else {
       get_search_form;
    }
    echo '<div id="footer">'; ?>

    I didn’t check the logic you are using, just stated it in a way that what you are trying will run.

    Umm … *blink*

    <?php
    // Checks to see whether it needs a sidebar or not. If not, post a search box
    if ( !empty($withcomments) && is_single() ) { get_search_form(); }
    echo '<div id="footer">';
    ?>

    Or …

    <?php
    // Checks to see whether it needs a sidebar or not. If not, post a search box
    if ( !empty($withcomments) && is_single() ) { get_search_form(); }
    ?>
    <div id="footer">

    I mean … just to keep things …. simple …

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Please help :)’ is closed to new replies.