Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

WordPress

Slider Images Not Showing white box only

I've added the following codes:

Below added to Header.php <!-- jQuery library (served from Google) --> <script src="//ajax.googleapis.com/ajax/libs/jquery/1.8.2/jquery.min.js"></script> <!-- bxSlider Javascript file --> <script src="<?php bloginfo('stylesheet_directory'); ?>/js/jquery.bxslider.min.js"></script> <!-- bxSlider CSS file --> <link href="/css/jquery.bxslider.css" rel="stylesheet" />

Below also added to header.php

<script type="text/javascript"> $(document).ready(function(){ $('.bxslider').bxSlider({ mode: 'fade', captions: 'true', auto: 'true', autoControls: 'false', }); }); </script>

Below added to front-page.php because this is where I want the slider to be displayed

<?php $content = '<ul class="bxslider">'; $loop = new WP_Query( array( 'post_type' => '', '5' => 10, 'post_status' => 'publish', 'orderby' => 'date', 'order' => 'DESC' ) ); while ( $loop->have_posts() ) : $loop->the_post(); $thumb_id = get_post_thumbnail_id(); $thumb_url = wp_get_attachment_image_src($thumb_id,'full', true); $content .= '<li><a href="'; $content .= get_permalink(); $content .= '"><img src="'; $content .= $thumb_url[0]; $content .= '" alt="'; $content .= get_the_title(); $content .= '" /></a></li>'; endwhile; $content .= '</ul>'; echo $content; ?> <?php if ( has_post_thumbnail() )?>

On my local site I have slider navigation and pagination and a white box displaying where post images should be, but no images displayed. The white box however does link to the proper post...can someone tell me what I'm doing wrong?

William Whitworth
William Whitworth
6,117 Points

It'd be easier to diagnose the issue if you provide the code in markdown, click the "Markdown Cheatsheet" link down below, under the textfield.