例如(在我的情况下)这里有一些代码,
<?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();
?>
现在我想放置以下 PHP 代码,以便在之前输出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; ?>
如果我必须从字面上显示它,代码将是这样的:
<?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();
?>
显然这不是正确的做法。那么,我该怎么做呢?