有人能帮我弄清楚我到底哪里做错了吗?幻灯片根本不起作用
<!-- Carousel Card -->
<div class="card card-raised card-carousel">
<div id="carouselExampleIndicators" class="carousel slide" data-ride="carousel" data-interval="3000">
<ol class="carousel-indicators">
<li data-target="#carouselExampleIndicators" data-slide-to="0" class="active"></li>
<li data-target="#carouselExampleIndicators" data-slide-to="1" class=""></li>
<li data-target="#carouselExampleIndicators" data-slide-to="2" class=""></li>
</ol>
<?php $paged=(get_query_var(\'paged\'))? absint (get_query_var(\'paged\')):1;
$args=array(\'post_type\'=>\'slide\',
\'post_per_page\'=>1,
\'paged\'=>$paged);
$slideshow=new WP_Query ($args);
?>
<?php while($slideshow->have_post()): $slideshow->the_post();?>
<div class="carousel-inner" role="checkbox">
<div class="carousel-item active">
<?php echo get_post_thumbnail(); ?>
alt="First slide">
<div class="carousel-caption d-none d-md-block">
<h4>
<i class="material-icons"><?php the_title(); ?></i>
<?php the_excerpt(); ?>
</h4>
</div>
</div>
<?php endwhile; wp_reset_query();?>
<?php $paged=(get_query_var(\'paged\'))? absint (get_query_var(\'paged\')):1;
$args=array(\'post_type\'=>\'slide\',
\'post_per_page\'=>-1,
\'offset\'=>1,
\'paged\'=>$paged);
$slideshow=new WP_Query ($args);
?>
<?php while($slideshow->have_post()): $slideshow->the_post();?>
<div class="carousel-item">
<?php echo get_post_thumbnail(); ?>
<div class="carousel-caption d-none d-md-block">
<h4>
<i class="material-icons"><?php the_title(); ?></i>
</h4>
</div>
</div>
<?php endwhile; wp_reset_query();?>
<?php $paged=(get_query_var(\'paged\'))? absint (get_query_var(\'paged\')):1;
$args=array(\'post_type\'=>\'slide\',
\'post_per_page\'=>-1,
\'offset\'=>1,
\'paged\'=>$paged);
$slideshow=new WP_Query ($args);
?>
<?php while($slideshow->have_post()): $slideshow->the_post();?>
<div class="carousel-item">
<?php echo get_post_thumbnail(); ?>
<div class="carousel-caption d-none d-md-block">
<h4>
<i class="material-icons"><?php the_title(); ?></i>
</h4>
</div>
</div>
<?php endwhile; wp_reset_query();?>
</div>
<a class="carousel-control-prev" href="#carouselExampleIndicators" role="button" data-slide="prev">
<i class="material-icons">keyboard_arrow_left</i>
<span class="sr-only">Previous</span>
</a>
<a class="carousel-control-next" href="#carouselExampleIndicators" role="button" data-slide="next">
<i class="material-icons">keyboard_arrow_right</i>
<span class="sr-only">Next</span>
</a>
</div>
</div>
<!-- End Carousel Card -->
功能。php
function cptui_register_my_cpts() {
/**
* Post Type: slide.
*/
$labels = array(
"name" => __( "slide", "oiza" ),
"singular_name" => __( "slide", "oiza" ),
);
$args = array(
"label" => __( "slide", "oiza" ),
"labels" => $labels,
"description" => "",
"public" => true,
"publicly_queryable" => true,
"show_ui" => true,
"delete_with_user" => false,
"show_in_rest" => true,
"rest_base" => "",
"rest_controller_class" => "WP_REST_Posts_Controller",
"has_archive" => false,
"show_in_menu" => true,
"show_in_nav_menus" => true,
"exclude_from_search" => false,
"capability_type" => "post",
"map_meta_cap" => true,
"hierarchical" => true,
"rewrite" => array( "slug" => "slide", "with_front" => true ),
"query_var" => true,
"supports" => array( "title", "editor", "thumbnail", "author" ),
);
register_post_type( "slide", $args );
}
add_action( \'init\', \'cptui_register_my_cpts\' );