Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/wordpress/11.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 自定义帖子类型滑块不显示_Php_Wordpress_Slider_Owl Carousel - Fatal编程技术网

Php 自定义帖子类型滑块不显示

Php 自定义帖子类型滑块不显示,php,wordpress,slider,owl-carousel,Php,Wordpress,Slider,Owl Carousel,自定义post类型owl滑块正确显示,我正在创建自定义post类型并使用owl转盘滑块注册功能,但短代码循环工作正常 自定义owl滑块短代码 function custom_owl($para,$content){ $para = shortcode_atts ( array( '' => '', ), $para);ob_start(); $cutting_slider = null; $cutting_slider = new WP_Query( array ('post_type

自定义post类型owl滑块正确显示,我正在创建自定义post类型并使用owl转盘滑块注册功能,但短代码循环工作正常

自定义owl滑块短代码

function custom_owl($para,$content){
$para = shortcode_atts ( array(
'' => '',
), $para);ob_start();  
$cutting_slider = null;
$cutting_slider = new WP_Query( array ('post_type'     => 'custom_cuttingsystem','posts_per_page' => -1,'orderby' => 'rand'));
if($cutting_slider->have_posts()) {
while ( $cutting_slider->have_posts()) {
$cutting_slider->the_post(); ?>
<div class="owl-carousel owl-theme">
<div class="item">
<?php the_post_thumbnail ();?>
<a href="<?php the_permalink() ?>">
<h4><?php the_title(); ?></h4></a>
<span><?php the_category(); ?></span>
</div></div>
<?php }}
wp_reset_postdata();
$cutting_slider = null; return ob_get_clean();
}
add_shortcode ('owl-slider','custom_owl');
注册子主题owl函数排队脚本

function custom_owlcarousel() {

wp_enqueue_style('owlmin-css', get_stylesheet_directory_uri().'/owl/owl.carousel.min.css', 'all');

wp_enqueue_style('owldefault', get_stylesheet_directory_uri().'/owl/owl.theme.default.min.css', 'all');

 wp_enqueue_script('carousel-js', get_stylesheet_directory_uri().'/owl/owl.carousel.js', array('jquery'), NULL, true);

 // wp_enqueue_script('owl-jq', get_stylesheet_directory_uri().'/owl/jquery.min.js', array('jquery'), NULL, true);
}
add_action( 'wp_enqueue_scripts', 'custom_owlcarousel' );
function custom_owlcarousel() {

wp_enqueue_style('owlmin-css', get_stylesheet_directory_uri().'/owl/owl.carousel.min.css', 'all');

wp_enqueue_style('owldefault', get_stylesheet_directory_uri().'/owl/owl.theme.default.min.css', 'all');

 wp_enqueue_script('carousel-js', get_stylesheet_directory_uri().'/owl/owl.carousel.js', array('jquery'), NULL, true);

 // wp_enqueue_script('owl-jq', get_stylesheet_directory_uri().'/owl/jquery.min.js', array('jquery'), NULL, true);
}
add_action( 'wp_enqueue_scripts', 'custom_owlcarousel' );