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 trialDaniel Zayas
3,109 PointsFlexslider not working for me.
I've gone through the Wordpress Theme tutorial and the flexslider isn't a slider, but is still in the stacked divs, similar to how it looks before Zac fixes the js code. I fixedthe js code and it doesn't do anything.
Here's my code:
<?php get_header('header.php'); ?>
</div>
<div id="featured" class="clearfix flexslider">
<ul class="slides">
<?php
$args = array(
'post_type' => 'work'
);
$the_query = new WP_Query( $args );
?>
<?php if ( have_posts() ) : while ( $the_query->have_posts() ) : $the_query->the_post(); ?>
<li style="background-color:<?php the_field( 'background_color' ); ?>">
<div class="container">
<div class="grid_8">
<img src="<?php the_field( 'homepage_slider_image' ); ?>" alt="<?php the_title(); ?> Project Screenshot">
</div>
<div id="featured-info" class="grid_4 omega">
<h3 style="color: <?php the_field( 'button_color' ); ?>"><?php the_title(); ?></h3>
<p><?php the_field( 'description' ); ?></p>
<a class="btn blue" style="background-color: <?php the_field( 'button_color' ); ?>" href="<?php the_permalink(); ?>">View Project →</a>
</div>
</div>
</li>
<?php endwhile; endif; ?>
</ul>
</div>
And here's my js code:
jQuery(document).ready(function($) {
$('.flexslider').flexslider();
});
Thoughts?
2 Answers
Daniel Zayas
3,109 PointsFor some reason it shot the close tags out of the markup gray area. That is part of my code for js too.
Diogo Gomes
7,054 PointsHi Daniel,
It's hard to see it like this. What kind of error it returns? the images appear?
Could you upload the code somewhere, so we could see it?
Cheers, Diogo Gomes
Daniel Zayas
3,109 PointsI posted a similar question on Stack Overflow.
I can see all the pictures/captions and they are all correctly placed, but they are stacked like an actual unordered list instead of the flexslider activating. Unless there's some random typo, which it could be of course, I've followed the Build a Wordpress Theme tutorial on here to a T.
With any of those files I can copy the code directly, otherwise I'm not sure how to better display my files.
Diogo Gomes
7,054 PointsI've answered on stackoverflow. Cheers