WordPress.org

Ready to get started?Download WordPress

Forums

Bootstrap Slider Not Appearing on Custom Theme (1 post)

  1. laichejl
    Member
    Posted 4 months ago #

    Hello,

    I am currently developing my first custom theme; I'm transferring a website I made in class using Bootstrap into a theme with custom WordPress content. I'm using a static homepage. In my original website, I used a Bootstrap carousel I found on Google, which was just some custom CSS and corresponding HTML based on the Bootstrap framework. I've tried implementing that into my front-page.php file but the slider will not show up.

    I've checked my source code and both the CSS and JS files are appearing on my page, so thats not the issue. Here is the code I've used to make the slider appear:

    <div id="myCarousel" class="carousel slide">
    			<div class="carousel-inner">
    				<?php $args = array(
    					'category_name' => 'Slider'
    					); ?>
    				<?php
    				$the_query = new WP_Query($args);
    				?>
    				<?php if( have_posts() ) : while ( $the_query->have_posts() ) : $the_query->the_post(); ?>
    				<div class="item">
    					<?php the_post_thumbnail(); ?>
    				</div>
    			<?php endwhile; endif; ?>
    
    			<a class="left carousel-control" href="#myCarousel" data-slide="prev">&lsaquo;</a>
    			<a class="right carousel-control" href="#myCarousel" data-slide="next">&rsaquo;</a>
    		</div>
    	</div>

    You can find my webpage at http://www.testing.jaylaiche.com. Thanks for the help in advance!

Reply

You must log in to post.

About this Topic