Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/278.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php wordpress站点上的Jquery内部while循环问题_Php_Jquery_Wordpress - Fatal编程技术网

Php wordpress站点上的Jquery内部while循环问题

Php wordpress站点上的Jquery内部while循环问题,php,jquery,wordpress,Php,Jquery,Wordpress,jquery在第二个网格之后不工作 <div class="carousel slide carousel1" id="myCarousel1"> <div class="carousel-inner"><?php $args = array('post_type'=>'post','post_status'=>'publish','orderby'=>'menu_order','order'=>'ASC',

jquery在第二个网格之后不工作

   <div class="carousel slide carousel1" id="myCarousel1">
      <div class="carousel-inner"><?php 
       $args = array('post_type'=>'post','post_status'=>'publish','orderby'=>'menu_order','order'=>'ASC','posts_per_page'=>'2',
           'tax_query' => array(array('taxonomy' =>'category','field'=>'slug','terms'=>'videos')));
       $team = new WP_Query($args);
       if($team->have_posts()){
           while ( $team->have_posts() ) : $team->the_post();?>
              <div class="item">
                 <div class="panel col-md-4 col-xs-12">                        
                    <div class="panel-header">
                        <h4><?php the_title();?></h4>                                                      
                    </div>  

                 </div>
              </div><?php 
              endwhile;
           }?>                 
       </div>

    </div>
试试这个:

jQuery(document).ready(function($) {
  $( ".panel-header h4" ).each(function() {
      $(this).click(function(){
         alert('sdfds');
      });

    });
});

如果这不是PHP问题,请不要发布PHP。单击,然后单击
[]
代码段编辑器,并使用HTML、CSS和Scriptcreate JSFIDLE生成一个代码段。您是否收到任何控制台错误?类型错误:siteBranding未定义
jQuery(document).ready(function($) {
  $( ".panel-header h4" ).each(function() {
      $(this).click(function(){
         alert('sdfds');
      });

    });
});