Wordpressda slider

0 ovoz
49 marta ko‘rilgan
so‘radi 20 iyul Bunyodbek (37 bal)
Assalomu aleykum Quyidagicha kod yozdim. Ammo Slider ishlamayapti. Qayerdadir xato qildimmi?

section-slider.php

<div class="row slider">
    <div class="col-sm-12">
        <div id="carouselControls" class="carousel slide" data-ride="carousel">
            <div class="carousel-inner">

<?php
//Вывод записей
$args = array(
    'post_type' => 'slides',
    'posts_per_page' => -1,
);
$slides = new WP_Query( $args ); ?>
<?php if( $slides->have_posts() ) : while ( $slides->have_posts() ) : $slides->the_post(); ?>

<?php if($i==1) { ?>
<div class="carousel-item active">
<?php } else { ?>
<div class="carousel-item">
<?php } ?>                
                    <div class="row">
                        <div class="col-4">
                            <div class="carousel-caption d-none d-md-block">
                                <h1><?php the_title(); ?></h1>
                                <p class="caption-text"><?php echo excerpt(15); ?></p>
                                <ul class="nav justify-content-start">
                                    <li class="nav-item">
                                        <a class="nav-link btn btn-1c btn-1c-red" href="<?php the_permalink(); ?>">Подробнее</a>
                                    </li>
                                </ul>
                            </div>
                        </div>
                        <div class="col-8">
                            <img class="d-block float-right" src="<?php bloginfo('template_url'); ?>/img/slide1.png" alt="<?php the_title(); ?>">
                        </div>
                    </div>
                </div>

<?php endwhile; else: ?>
    <h3>Записей нет</h3>
<?php endif; ?>

            </div>
        </div>
    </div>
</div>

function.php

add_action( 'init', 'tpl_slides' );
function tpl_slides() {
  register_post_type( 'slides', array(
    'public' => true,
    'labels' => array(
      'name' => __('Слайдеры'),
      'all_items' => __('Все Слайдеры'),
      'add_new' => __('Добавить Слайдеры'),
      'add_new_item' => __('Добавление Слайдеры')
      ),
    'supports' => array( 'title', 'thumbnail', 'editor', 'custom-fields' ),
    'taxonomies' => array( 'post_tag')
    )
  );
};

Iltimos, saytga kiring yoki ro‘yxatdan o‘ting va shunda ushbu savolga javob berishingiz mumkin bo‘ladi.

Assalomu alaykum, yordam.uz saytimizga xush kelibsiz.

Bu saytda o`zingizni qiziqtirgan savollarga javob olishingiz va o`z sohangiz bo`yicha savollarga javob berishingiz mumkin.

Bizning Oilamizga a'zo bo`lganingiz uchun chuqur Minnatdorchilik bildiramiz !!!

Telegram kanal YordamUzRss

...