0

同じ問題を再投稿していますが、問題をよりよく定義しています。

基本的に、インデックスページに表示される記事の数を制限しようとしていました-しかし、私が作成したCATEGORYページを壊すことができたようです.

たとえば、http://www.invisiblejungle.comにアクセスすると、「ラジオ番組」カテゴリから取得した「最近の投稿」セクションが問題なく表示されます。

ただし、カテゴリであるナビゲーション バーの [ラジオ番組] をクリックすると、サイドバー ウィジェットがページの下部にスローされ、個々の記事がゆがめられます。

編集:

投稿を取得するとき、問題は間違いなく loop.php にあることがわかりました。

<?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 &rarr;', '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 &rarr;', '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">&larr;</span>' . __( ' Older posts', 'framework' ) ); ?></div>

                <div class="nav-next"><?php previous_posts_link( __( 'Newer posts ', 'framework' ) . '<span class="meta-nav">&rarr;</span>' ); ?></div>

            <?php endif; // End WP Page Navi plugin check ?>


        </div><!-- #nav-below -->

    <?php endif; // end page check ?>

</section><!-- #entry-container -->
4

2 に答える 2

0

問題はおそらく 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

http://codex.wordpress.org/Template_Hierarchy

したがって、おそらくエラーはそのファイルにあります。ただし、これを修正するためにできることは、非常にうまく機能しているファイルに移動することです。あなたのように、page.phpそのすべての内容を にコピーしますarchive.php。最初に必ずバックアップしてください!

于 2012-12-06T04:42:08.223 に答える
0
<div id="main-container" role="main">

<section id="main">    

<section id="entry-container" role="contentinfo">////   


    <header class="entry page-header">

    ....
    ....
    ....            


    </ul><!-- #sidebar -->

</section><!-- #sidebar-container -->

</section><!-- #main -->////



    <div class="clearfix"><!-- nothing to see here --></div>

</div>

//// の後に置いた行は、html を修正するものです。比較できるように、作業中のページの 1 つから php を投稿してください。

于 2012-12-05T05:06:28.560 に答える