dongzhui9936 2014-06-18 14:57
浏览 51
已采纳

Wordpress循环不起作用[关闭]

Can anyone tell me why this wordpress blog is looping the header and banner over and over? It seems like instead of just looping the post it is looping the whole page.

Here is a link to my blog: http://testing.printlabelandmail.com/blog/

<?php
/**
* The default template for displaying content.
*/
get_header(); ?>

<!-- Start Top Header affix nav-->
<div id="affix" data-spy="affix" data-offset-top="94" data-offset-bottom="0">

<!-- **** START - NAVBAR SCROLLSPY FIX DO NOT REMOVE **** 
<div id="top" class="hide"></div>
<!-- **** END - NAVBAR SCROLLSPY FIX DO NOT REMOVE **** -->

<!-- **** START - NAV **** -->
<nav class="navbar navbar-default navbar-shrink">
<div class="container">
<div class="navbar-header">
<!-- main-logo goes here-->
<h1 class="brand--font"><a href="<?php echo esc_url( home_url( '/' ) ); ?   >">        PRINTLABELANDMAIL.COM</a></h1>
    <button type="button" class="navbar-toggle" data-toggle="collapse" data-    target=".navbar-ex1-collapse">
      <span class="icon-menu"></span>
    </button>
            </div>
<!-- **** START - NAVBAR SCROLLSPY FIX DO NOT REMOVE **** -->
<li class="hide"><a href="#top"></a></li>
<!-- **** END - NAVBAR SCROLLSPY FIX DO NOT REMOVE **** -->
<?php

$defaults = array(
'theme_location'  => '',
'menu'            => 'main-nav',
'container_id'    => 'nav',
'container_class' => 'navbar navbar-default navbar-shrink',
'container'       => 'div',
'container_class' => 'collapse navbar-collapse navbar-ex1-collapse',
'container_id'    => '',
'menu_class'      => 'menu',
'menu_id'         => '',
'echo'            => true,
'fallback_cb'     => 'wp_page_menu',
'before'          => '',
'after'           => '',
'link_before'     => '',
'link_after'      => '',
'items_wrap'      => '<ul class="nav navbar-nav">%3$s</ul>',
'depth'           => 0,
'walker'          => ''
);

wp_nav_menu( $defaults );

?>
        </div>
    </nav><!-- **** END - NAV **** -->
</div><!-- **** END -affix NAV **** -->
<!-- end Top Header affix nav-->

<!-- **** start blog banner **** -->    
<div id="blog-banner">

<?php if (function_exists('dynamic_sidebar') && dynamic_sidebar('blog-banner')) :     else : ?>
<div class="pre-widget">
    <p><strong>Widgetized Area</strong></p>
    <p>This panel is active and ready for you to add some widgets via the WP  Admin</p>
</div>

<?php endif; ?>

</div>
<!-- **** / end blog banner **** -->    

<!-- **** START - BLOG **** -->
<div class="container  blog">
  <div class="row  blog--row">

    <!-- **** START - LEFT CONTENT -->
    <div class="col-lg-8">

      <!-- blog post -->
<!-- blog post -->
<article <?php post_class('box  box--md  blog--post  push--bottom-sml'); ?>>

<?php the_post_thumbnail('thumbnail', array('class' => 'img-responsive push--bottom')); ?>

<h3 class="brand--font-standard"><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h3>

<h5 class="brand--font-light"><?php _e('posted by'); ?> <?php  the_author(); ?></h5>

<ul class="list-inline  tags  blog--tags  push--bottom-tiny">             
<li><?php the_category(',') ?></li>
</ul>

<?php the_content('<p class="section-subtitle"><p class="btn  btn--orange  brand-- font">Read More</p></p>'); ?>

<?php comments_popup_link('No Comments &#187;', '1 Comment &#187;', '% Comments &#187;'); ?> 

<?php edit_post_link('Edit', ' &#124; ', ''); ?>
</article>

<div class="row">
        <div class="col-lg-12">
          <!-- pagination -->
<ul class="pagination">
            <li class="disabled  pagination--prev"><a href="#">&lt;</a></li>
            <li class="active"><a href="#">1</a></li>
            <li><a href="#">2</a></li>
            <li class="pagination--next"><a href="#">&gt;</a></li>
          </ul><!-- pagination -->
        </div>
      </div>
<ul class="pagination">
<li class="pagination--prev"><?php previous_post_link('<< %link') ?></li> <li     class="pagination--next"><?php next_post_link(' %link >>') ?></li>
          </ul>
</div><!-- **** END - LEFT CONTENT **** -->

<!-- **** START - RIGHT CONTENT **** -->
    <div class="col-lg-4  right-hand-bar">
<?php get_sidebar(); ?>
</div><!-- **** END - RIGHT CONTENT **** -->
</div>
</div><!-- **** END - BLOG **** -->
  • 写回答

1条回答 默认 最新

  • doutou7549 2014-06-18 15:14
    关注

    is that correct?? please double check

      <?php if (function_exists('dynamic_sidebar') && dynamic_sidebar('blog-banner')) :     else : ?>
    
    //i think i should be like below:
    
     <?php if (function_exists('dynamic_sidebar') && dynamic_sidebar('blog-banner')) dynamic_sidebar( 'blog-banner' );  else : ?>
    
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 关于#hadoop#的问题
  • ¥15 (标签-Python|关键词-socket)
  • ¥15 keil里为什么main.c定义的函数在it.c调用不了
  • ¥50 切换TabTip键盘的输入法
  • ¥15 可否在不同线程中调用封装数据库操作的类
  • ¥15 微带串馈天线阵列每个阵元宽度计算
  • ¥15 keil的map文件中Image component sizes各项意思
  • ¥20 求个正点原子stm32f407开发版的贪吃蛇游戏
  • ¥15 划分vlan后,链路不通了?
  • ¥20 求各位懂行的人,注册表能不能看到usb使用得具体信息,干了什么,传输了什么数据