Conditional statements work fine when I put text in between them but not code
-
Hello,
When I use the following I get a parse error. It works fine if I put normal text inside the quotes after echo but gets broken when I put the html/php:
<?php if (is_search()) { echo "<input type="text" name="s" onblur="if (this.value == '') {this.value = 'Search';}" onfocus="if (this.value == 'Search') {this.value = '';}" value="Search" class="search_bar" />"; } else { echo "<input type="text" name="s" value="<?php the_search_query(); ?>" class="search_bar_2" />"; } ?>
Please help.
Viewing 5 replies - 1 through 5 (of 5 total)
Viewing 5 replies - 1 through 5 (of 5 total)
- The topic ‘Conditional statements work fine when I put text in between them but not code’ is closed to new replies.