blechblehblah
Member
Posted 2 weeks ago #
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
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 ...