<?php
get_header();
?>
<!-- PORTFOLIO AREA -->
<section>
<hr class="no-margin" />
<?php
wp_nav_menu(array(
'theme_location' => 'category-menu',
'container' => '',
'menu_class' => 'inline align-center portfolio-header',
'menu_id' => 'portfolio-sorting'
));
?>
<div class="middle-container section-content">
<div class="container">
<?php if (have_posts()) : ?>
<ul class="row portfolio-entries">
<?php while(have_posts()) : the_post(); ?>
<li class="span4 box portfolio-entry">
<div class="hover-state align-right">
<p><?php the_title(); ?></p>
<em>Click to see project</em>
<!-- end hover-state -->
</div>
<?php if (has_post_thumbnail()) : ?>
<figure>
<a href="<?php the_permalink(); ?>">
<?php the_post_thumbnail(); ?>
</a>
</figure>
<?php endif; ?>
</li>
<? endwhile; ?>
</ul>
<?php else: ?>
<div class="middle-container section-content">
<div class="container box section-content align-center"><h2>No posts were found.</h2>
<!-- end container -->
</div>
<!-- end middle-container -->
</div>
<?php endif; ?>
<div class="box align-center portfolio-nav">
<ul class="inline">
<li><a href="#" class="btn">← Previous Page</a></li>
<li><a href="#" class="btn">Next Page →</a></li>
</ul>
<!-- end cta -->
</div>
<!-- end container -->
</div>
<!-- end middle-container -->
</div>
<!-- End Portfolio Area -->
</section>
<?php get_footer();
?>
我正在尝试学习Wordpress主题开发,我现在对PHP和Wordpress的编码是新手/新鲜的,我只是想了解PHP的编码以及如何开发Wordpress主题。在 Wordpress 主题期间,我得到了标题栏中给出的错误行,但我无法理解为什么我会收到此错误..?
请帮忙.. ??
你用过
<? endwhile; ?>
而不是
<?php endwhile; ?>
如果未设置 php.ini 中的short_open_tag
,第一个可能不起作用。
有关详细信息,请参阅此问题。