Forum Replies Created

Viewing 5 replies - 1 through 5 (of 5 total)
  • Thread Starter nathanrobjohn

    (@nathanrobjohn)

    Thanks will take a look into that, haven’t really had time to go over the site yet. Just about to start work on another site for Cardiff developers.

    Thread Starter nathanrobjohn

    (@nathanrobjohn)

    Thanks guys! got it working by enqueue them didn’t know it was necessary now.

    final code it anyone needs it.

    <?php wp_enqueue_script('flex_header'); ?>
    <script type="text/javascript" charset="utf-8">
      $(window).load(function() {
        $('.flexslider').flexslider({
    	directionNav: "true"
    	});
      });
    </script>
    function flex_header() {
    
        //wp_enqueue_script('jquery');
    
        wp_register_script( 'add-flex-js', get_template_directory_uri() . '/jquery.flexslider.js', array('jquery'),'',true  );
        wp_register_script( 'add-flex-custom-js', get_template_directory_uri() . '/jquery.flexslider-min.js', '', null,''  );
        wp_register_style( 'add-flex-css', get_template_directory_uri() . '/flexslider.css','','', 'screen' );
    
        wp_enqueue_script( 'add-flex-js' );
        wp_enqueue_script( 'add-flex-custom-js' );
        wp_enqueue_style( 'add-flex-css' );
    
    }
    
    add_action( 'wp_enqueue_scripts', 'flex_header' );
    <div class="flexslider">
    	<ul class="slides">
    	<?php
    	query_posts(array('post_type'=>'Slider', 'category_name' => 'Residential'));
    	if(have_posts()) :
    	    while(have_posts()) : the_post();
    	?>
    	  <li>
    		<?php the_post_thumbnail(); ?>
    		<p class="flex-caption"><?php the_title(); ?></p>
    	  </li>
    	<?php
    	    endwhile;
    	endif;
    	wp_reset_query();
    	?>
    	</ul>
      </div>

    Thank you so much for your help.

    Thread Starter nathanrobjohn

    (@nathanrobjohn)

    i will be enqueueing them but i want to make sure it works properly first is that ok?

    Thread Starter nathanrobjohn

    (@nathanrobjohn)

    Sorry im getting one error

    Uncaught TypeError: Object [object Object] has no method ‘flexslider’ localhost/:49
    (anonymous function) localhost/:49
    x.event.dispatch jquery.min.js:5
    v.handle

    Thread Starter nathanrobjohn

    (@nathanrobjohn)

    Yes i am and no their is no errors showing i am using googles

Viewing 5 replies - 1 through 5 (of 5 total)