Php wordpress站点上的Jquery内部while循环问题
jquery在第二个网格之后不工作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',
<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');
});
});
});