私は基本的にカテゴリ作業の中にいくつかのPHPを表示したいと思いますが、私はif文と出力PHPを自分で作成する方法を知っていますが、 2つ、誰かが私を啓発することができればそれは大いに感謝されるだろう。基本的なコードは以下の通りですが、私は私には許されていないと推測しています<?php inside a <?php?
PHPがelse if文の中にPHP -
多くの感謝!
<?php // Outputting related work if in work category
if (in_category('work')) {
echo "
<section class='work'>
<h2>Also of interest</h2>
<?php query_posts('category_name=work&posts_per_page=3&order=DSC&offset=1&orderby=ID');
if (have_posts()) : while (have_posts()) : the_post(); ?>
<article>
<a href='<?php the_permalink() ?>'>
<?php the_post_thumbnail();?>
<h3><?php the_title(); ?></h3>
<span>Redesign</span>
<?php the_excerpt($strip_teaser); ?>
</a>
</article>
<?php endwhile; endif; wp_reset_query();?>
<a class='all' href='/work'>→ View all work</a>
</section> <!-- end work -->
";
}
?>
ありがとうございました。 – Nick