Can't implement my old theme into Roots

I’m trying to convert an old theme I did some months ago to Roots. This is a bit frustrating for me… because I dont understand where place the alternative loops and either how query my custom posts. Could you help me?
This code runs ok in my old theme:

<section id="slider">
	<?php query_posts( array( 'post_type' => 'destacados', 'category_name' => '', 'posts_per_page' => 4 )); ?>
	<ul class="cycle-slideshow color_3" data-cycle-slides="li" data-cycle-timeout="7000" data-cycle-speed="200" data-cycle-manual-speed="200" data-cycle-pause-on-hover="true">
    <?php if (have_posts()) : ?>
	<?php while (have_posts()) : the_post(); ?>
		<h4><?php the_title(); ?>
		<?php if ( get_field('subtitulo') ) {?>
				<?php the_field('subtitulo'); ?>
		<?php }?>			
		<a href="<?php the_field('enlazar_imagen'); ?>" title="<?php the_title_attribute(); ?>">
		<img src="<?php the_field('imagen'); ?>" alt="" />

	<?php endwhile; ?><div class="cycle-pager"></div>	
	<?php wp_reset_query(); ?>

<?php else : ?>
	<h2 class="center">No encontrado</h2>
	<p class="center">Ups, lo que buscas no est&aacute; aqu&iacute;…</p>
<?php endif; ?>

	</section><!-- #slider-container -->

What exactly are you trying to do? It looks like this is part of a slider. Are there errors? What do you get when you place this? Are you running the JavaScript along side with this for the slider?

thanks for reply Skylab,
in my old theme this piece of code was for a slider without errors in slider-posts.php
the javascript placed on header:

<script type="text/javascript" src="<?php bloginfo('template_directory'); ?>/js/jquery.cycle2.min.js"></script>

Maybe was not a good practice but it run, basically query a custom post type and slider show the images I put into the post with ACF plugin (but it also can pick up the post_thumbnails.

This is my old method of develop a theme while i’m not a developer, I’m a designer trying to do bests websites, trying to understand how Roots thinks…

(sorry for my bad english) :wink:

Loops and custom queries in Roots are the same as any other theme. What’s the problem you’re running into? Like @Skylab said - are you getting JS errors? If you are, it’s not specific to Roots


I dont get any js errors, ¿? what I ask is where are the most indicated places to place the code. My english is not very good…

For instance, to enqueue the cycle2 js it seems to be scripts.js, no?
I have not found too much documentation about the best practices… Sorry if I’m a teeny newbe in a huge theme framework. I’m tryin to understand.

thanks. :wink:

Roots 101 covers where you should be placing JS plugins: