我正在尝试根据自定义帖子类型输出不同的文本,并且我收到了一个语法错误,我认为这是由于多个 if 语句造成的。问题是我对 PHP 的了解非常有限。有任何想法吗?
<?php
if ( 'lettering' == get_post_type() ) {
<?php if( function_exists( 'attachments_get_attachments' ) ) {
$attachments = attachments_get_attachments();
$total_attachments = count( $attachments );
if( $total_attachments ) : ?>
<ul id="process"><span>Process:</span>
</ul>
<br>
<?php endif; ?> <?php } ?>
} elseif ( 'type' == get_post_type() ) {
<?php if( function_exists( 'attachments_get_attachments' ) ) {
$attachments = attachments_get_attachments();
$total_attachments = count( $attachments );
if( $total_attachments ) : ?>
<ul id="process"><span>Additional Shots</span>
</ul>
<br>
<?php endif; ?> <?php } ?>
}
?>