For example (in my case) here’s some code,
<?php
woo_post_inside_before();
if ( $woo_options['woo_post_content'] != 'content' AND !is_singular() )
woo_image( 'width='.$woo_options['woo_thumb_w'].'&height='.$woo_options['woo_thumb_h'].'&class=thumbnail '.$woo_options['woo_thumb_align'] );
the_title( $title_before, $title_after );
woo_post_meta();
?>
Now I would like to place the following PHP code so that it’s output before woo_post_meta();
:
<?php if (is_single()) : ?>
<div class="testb"><img src="http://whatthenerd.com/what/wp-content/themes/canvas/300.jpg" alt="test Ad" /></div>
<?php endif; ?>
If I have to show it literally, the code would be like this:
<?php
woo_post_inside_before();
if ( $woo_options['woo_post_content'] != 'content' AND !is_singular() )
woo_image( 'width='.$woo_options['woo_thumb_w'].'&height='.$woo_options['woo_thumb_h'].'&class=thumbnail '.$woo_options['woo_thumb_align'] );
the_title( $title_before, $title_after );
<?php if (is_single()) : ?>
<div class="testthisad"><img src="http://whatthenerd.com/what/wp-content/themes/canvas/300.jpg" alt="test Ad" /></div>
<?php endif; ?>
woo_post_meta();
?>
Apparently that’s not the right way of doing it. So, how do I do it?
Just have one set of tags:
There’s many ways to do it. Here’s one.
This will do what you want (not tested):
http://www.w3schools.com/php/php_if_else.asp?output=print
You can do
Have in mind though that’s crazy dangerous.
But in your case I think you can just do