iamtrying使用if语句,以便使用/不使用基于post格式的条目标题。标题不应出现在引号和链接中。
此时,我一次只能在if语句中放入一种post格式。
这项工作:
<?php if ( !has_post_format( 'quote' ) ): // Quote ?>
<?php the_title( '<h2 class="entry-title" itemprop="name headline"><a href="' . esc_url( get_permalink() ) . '" itemprop="url">', '</a></h2>' ); ?>
<?php endif; ?>
这不起作用:
<?php if ( !has_post_format( 'quote' ) || !has_post_format( 'link' ) ): // Quote or Link ?>
<?php the_title( '<h2 class="entry-title" itemprop="name headline"><a href="' . esc_url( get_permalink() ) . '" itemprop="url">', '</a></h2>' ); ?>
<?php endif; ?>
如何使最后一个代码生效?