Wordpress Themes - WP Forum at BFA
Click here to register or to donate.
Auto self-registration is not available here - far too many spammers. This forum has many, many backlinks and because of that there is an intense desire among spammers to drop their links here.

Wordpress Themes - WP Forum at BFA » WordPress Themes » Atahualpa 3 Wordpress theme » Center area post/pages »

jQuery Post Slider....where to put javascript files


  #1  
Old Sep 15, 2012, 03:18 PM
theadventurebite
 
136 posts · May 2010
Hi All,

I am trying to integrate FlexSlider into my theme to use as a post slider and I have followed this tutorial to try to do so and have done everything the way they have specified:

http://return-true.com/2012/04/insta...rdpress-theme/

I have this in my page-home.php

Code:
<div class="flex-container">
  <div class="flexslider">
	<ul class="slides">
	<?php
	query_posts(array('category_name' => 'food', 'posts_per_page' => 3));
	if(have_posts()) :
	    while(have_posts()) : the_post();
	?>
	  <li>
		<?php the_post_thumbnail(); ?>
		<p class="flex-caption"><?php the_excerpt(); ?></p>
	  </li>
	<?php
	    endwhile;
	endif;
	wp_reset_query();
	?>
	</ul>
  </div>
</div>
This is in my functions.php:

Code:
function my_add_scripts() {
    wp_enqueue_script('flexslider', get_bloginfo('stylesheet_directory').'js/jquery.flexslider-min.js', array('jquery'));
    wp_enqueue_script('flexslider-init', get_bloginfo('stylesheet_directory').'js/flexslider-init.js', array('jquery', 'flexslider'));
}
add_action('wp_enqueue_scripts', 'my_add_scripts');

function my_add_styles() {
    wp_enqueue_style('flexslider', get_bloginfo('stylesheet_directory').'js/flexslider.css');
}
add_action('wp_enqueue_scripts', 'my_add_styles');
integrated here:

Code:
<?php
$bfa_ata_version = "3.7.3";

// Load translation file above
load_theme_textdomain('atahualpa');

// To disable some default WP filters, remove the '#' character
#remove_filter('the_content', 'wptexturize');
#remove_filter('the_excerpt', 'wptexturize');
#remove_filter('comment_text', 'wptexturize');
#remove_filter('the_title', 'wptexturize');
add_filter('widget_text', 'do_shortcode');


function my_add_scripts() {
    wp_enqueue_script('flexslider', get_bloginfo('stylesheet_directory').'js/jquery.flexslider-min.js', array('jquery'));
    wp_enqueue_script('flexslider-init', get_bloginfo('stylesheet_directory').'js/flexslider-init.js', array('jquery', 'flexslider'));
}
add_action('wp_enqueue_scripts', 'my_add_scripts');
function my_add_styles() {
    wp_enqueue_style('flexslider', get_bloginfo('stylesheet_directory').'js/flexslider.css');
}
add_action('wp_enqueue_scripts', 'my_add_styles');



// get default theme options
include_once (TEMPLATEPATH . '/functions/bfa_theme_options.php');
// Load options
include_once (TEMPLATEPATH . '/functions/bfa_get_options.php');
list($bfa_ata, $cols, $left_col, $left_col2, $right_col, $right_col2, $bfa_ata['h_blogtitle'], $bfa_ata['h_posttitle']) = bfa_get_options();
And then I created the file they specified called flexslide-init.js with this in it:

Code:
(function($) {
    $(window).load(function() {
        $('.flexslider').flexslider({
	            animation: 'slide',
		    controlsContainer: '.flex-container'
	    });
    });
})(jQuery)
All of the files are in the JS folder (including the CSS file. I have tried extending the file path to the full /www/wp-content/themes/atahualpa373/js with no difference.

So far all I have managed to achieve is getting the page to put out the first three posts with their excerpts, and the post titles are underneath the posts.

It obviously works for lots of other people so I'm no sure why its not working on mine.

Help?

Dani

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
Want a javascript driven Home page "menu" -- jQuery example available Zorba Customization, Design, Programming... 1 Sep 22, 2011 07:01 AM
[SOLVED] Easing Slider Plugin, How to Center Slider in Header netinfused Plugins & Atahualpa 1 Feb 22, 2011 02:22 PM
[SOLVED] Custom Javascript/jQuery Popup not working in Atahualpa. Factorfiction Page & Category Menu Bars 1 Jan 30, 2011 03:20 PM
Added a Jquery slider and header no longer rotates Elms123 Header configuration & styling 2 Jul 30, 2010 08:35 AM


All times are GMT -6. The time now is 05:22 AM.


Powered by vBulletin® Copyright ©2000 - 2018, Jelsoft Enterprises Ltd.