Php 侧边栏小部件在类别页面上未对齐
我正在发布相同的问题,但我更好地定义问题 基本上,我试图限制在我的索引页面上出现的文章数量——然而,似乎我设法打破了我创建的任何类别页面 例如,如果您转到,则从“Radio Shows”类别中提取的“最近的帖子”部分看起来很好 但是,如果您单击导航栏中的Radio Shows(这是一个类别),它会将边栏小部件扔到页面底部,并扭曲每个单独的文章 编辑: 我发现loop.php在检索帖子时肯定存在问题Php 侧边栏小部件在类别页面上未对齐,php,wordpress,categories,Php,Wordpress,Categories,我正在发布相同的问题,但我更好地定义问题 基本上,我试图限制在我的索引页面上出现的文章数量——然而,似乎我设法打破了我创建的任何类别页面 例如,如果您转到,则从“Radio Shows”类别中提取的“最近的帖子”部分看起来很好 但是,如果您单击导航栏中的Radio Shows(这是一个类别),它会将边栏小部件扔到页面底部,并扭曲每个单独的文章 编辑: 我发现loop.php在检索帖子时肯定存在问题 <?php /** * The loop for displaying multipl
<?php
/**
* The loop for displaying multiple posts (blog, search, categories, tags, etc).
*
* @package WordPress
* @subpackage Debut
* @since Debut 2.0
*
*/
?>
<?php if( have_posts() ) : ?>
<?php
/**
* Page Header
*
*/
locate_template( 'includes/page-header.php', true ); ?>
<?php while( have_posts() ) : the_post(); ?>
<article id="post-<?php the_ID(); ?>" <?php post_class( 'entry' ) ?>>
<?php
/**
* Entry Thumbnail
*
*/
locate_template( 'includes/entry-thumbnail.php', true, false ); ?>
<?php
/**
* Entry Header
*
*/
locate_template( 'includes/entry-header.php', true, false ); ?>
<?php
/**
* Entry Content/Summary
*
*/
if ( is_archive() || is_search() ) : // Check if this is an Archives and Search page ?>
<div class="entry-summary">
<?php the_excerpt(); ?>
<a class="more-link" href="<?php the_permalink() ?>" title="<?php c7s_the_title_attribute(); ?>"><?php _e( 'Read More →', 'framework' ); ?></a>
</div><!-- .entry-summary -->
<?php else : // If not Archives or Search page ?>
<div class="entry-content">
<?php global $more; $more = 0; // Needed for more tag to work ?>
<?php the_content( __( 'Read More →', 'framework' ) ); // Show content ?>
<?php do_action( 'get_page_links' ); // Show page links (custom function to wp_link_pages() - functions/theme-helpers.php ?>
</div><!-- .entry-content -->
<?php endif; // End Archive and Search page check ?>
</article><!-- #post-## -->
<?php
/**
* Entry Comments
*
*/
comments_template( '', true ); ?>
<?php endwhile; // end posts loop ?>
<?php else : // If there are not any posts ?>
<?php
/**
* Page Header
*
*/
locate_template( 'includes/page-header.php', true ); ?>
<?php
/**
* Archives
*
*/
get_template_part( 'loop', 'archives' ); ?>
<?php endif; // end loop ?>
<?php
/**
* Pagination
*
*/
if ( $wp_query->max_num_pages > 1 ) : // Check for pages ?>
<div id="nav-below" class="pagenavi">
<?php if ( function_exists( 'wp_pagenavi' ) ) : // Check for WP Page Navi Plugin ?>
<?php wp_pagenavi(); ?>
<?php else : ?>
<div class="nav-previous"><?php next_posts_link( '<span class="meta-nav">←</span>' . __( ' Older posts', 'framework' ) ); ?></div>
<div class="nav-next"><?php previous_posts_link( __( 'Newer posts ', 'framework' ) . '<span class="meta-nav">→</span>' ); ?></div>
<?php endif; // End WP Page Navi plugin check ?>
</div><!-- #nav-below -->
<?php endif; // end page check ?>
</section><!-- #entry-container -->
////
....
....
....
////
我放在///后面的行是修复html的内容。请从您的工作页面发布php,以便我进行比较。问题可能会出现在您的archive.php中
根据Wordpress模板层次结构,Wordpress按以下文件的顺序查找类别页面:
category-{slug}.php - If the category's slug were news, WordPress
would look for category-news.php category-{id}.php - If the category's
ID were 6, WordPress would look for category-6.php category.php
archive.php
index.php
因此,您的错误很可能位于该文件中。但是,要解决这个问题,您可以做的是进入一个运行良好的文件。例如您的page.php
,并将其所有内容复制到archive.php
。一定要先备份 你能列出你的主题文件夹中的文件吗。分类页面和搜索页面似乎正在这样做。有几个:注释(Comments.php)页脚(Footer.php)theme-helpers.php theme-metabox.php theme-tinymce.php theme-widgets.php主题函数(Functions.php)页眉(Header.php)home.php announcement.php archives.php entry-header.php entry-缩略图.php page-header.php主索引模板(Index.php)loop-archives.php loop-featured.php loop-hero.php loop-singular.php loop.php options-announcement.php options-featured.php options-footer.php options-general.php options-hero.php options-logo-icons.php options-menus.phpoptions-plugins.php options-save-the-web.php options-social-media.php options-thank-you.phpoptions-theme-styles.php options.php页面模板(Page.php)搜索表单(searchform.php)边栏-footer.php边栏(sidebar.php)单篇文章(Single.php)归档页面模板(Template Archives.php)居中页面模板(Template Centered.php)全宽页面模板(Template Full.php)自定义文章页面模板(template post page.php)很抱歉,我没有一个非常方便的方法在评论中这样做……我将在主文件中发布它。
category-{slug}.php - If the category's slug were news, WordPress
would look for category-news.php category-{id}.php - If the category's
ID were 6, WordPress would look for category-6.php category.php
archive.php
index.php