Php _类别循环permalink wordpress
我目前正在开发自己的wordpress主题,目前为止效果不错。问题是我使用的是永久链接和类别。该类别位于永久链接内。以下代码是我正在使用的(content.php):Php _类别循环permalink wordpress,php,wordpress,loops,nested-loops,Php,Wordpress,Loops,Nested Loops,我目前正在开发自己的wordpress主题,目前为止效果不错。问题是我使用的是永久链接和类别。该类别位于永久链接内。以下代码是我正在使用的(content.php): 当我将_类别留在那里时,发生了以下情况: 如果我离开_类别标签,一切正常。我已经检查了_类别的wp includes中的函数,但是找不到关于permalink的任何内容。有什么建议吗?我的循环如下所示: <?php get_header(); ?> <main id="projectengrid" cla
当我将_类别留在那里时,发生了以下情况:
如果我离开_类别标签,一切正常。我已经检查了_类别的wp includes中的函数,但是找不到关于permalink的任何内容。有什么建议吗?我的循环如下所示:
<?php get_header(); ?>
<main id="projectengrid" class="gridmenu-closed">
<section class="gridRightSmall">
<?php if ( have_posts() ) : ?>
<?php
// Start the loop.
while ( have_posts() ) : the_post();
get_template_part( 'content', get_post_format() );
// End the loop.
endwhile;
// Previous/next page navigation.
the_posts_pagination( array(
'prev_text' => __( 'Previous page', 'twentyfifteen' ),
'next_text' => __( 'Next page', 'twentyfifteen' ),
'before_page_number' => '<span class="meta-nav screen-reader-text">' . __( 'Page', 'twentyfifteen' ) . ' </span>',
) );
// If no content, include the "No posts found" template.
else :
get_template_part( 'content', 'none' );
endif;
?>
</section>
</main><!-- .site-main -->
<?php get_footer(); ?>
<?php get_header(); ?>
<main id="projectengrid" class="gridmenu-closed">
<section class="gridRightSmall">
<?php if ( have_posts() ) : ?>
<?php
// Start the loop.
while ( have_posts() ) : the_post();
get_template_part( 'content', get_post_format() );
// End the loop.
endwhile;
// Previous/next page navigation.
the_posts_pagination( array(
'prev_text' => __( 'Previous page', 'twentyfifteen' ),
'next_text' => __( 'Next page', 'twentyfifteen' ),
'before_page_number' => '<span class="meta-nav screen-reader-text">' . __( 'Page', 'twentyfifteen' ) . ' </span>',
) );
// If no content, include the "No posts found" template.
else :
get_template_part( 'content', 'none' );
endif;
?>
</section>
</main><!-- .site-main -->
<?php get_footer(); ?>