Reply To: If I have only 2 post in slider doesn't expand the photos

#22749
PhiLho
Participant

OK, I have solved my problem cleanly in my child theme.
I had to deactivate the kwicks and minimatica scripts from the parent, to put my own scripts in the child theme:


function minimatica_child_customize()
{
	// Load the main theme's stylesheet.
	wp_enqueue_style('minimatica-parent-style', get_template_directory_uri() . '/style.css');
	// Not necessary, automatic, apparently. Otherwise, loads it twice...
//	wp_enqueue_style( 'minimatica-child-style', get_stylesheet_directory_uri() . '/style.css', array( 'minimatica-parent-style' ) );
	// The script activating Kwicks
	wp_dequeue_script('kwicks');
	wp_deregister_script('kwicks');
	// The script activating Kwicks
	wp_dequeue_script('minimatica');
	wp_deregister_script('minimatica');
	// The replacements
	wp_enqueue_script('kwicks', get_stylesheet_directory_uri() . '/scripts/jquery.kwicks.min.js', array('jquery'));
	wp_enqueue_script('minimatica', get_stylesheet_directory_uri() . '/scripts/minimatica.js', array('kwicks'));
}
// http://wordpress.stackexchange.com/questions/26822/how-to-override-javascript-files-in-child-theme
// Delay the hook by lowering its priority to ensure the parent theme's registration has fired so we can undo it.
add_action('wp_enqueue_scripts', 'minimatica_child_customize', 1000);

As you can see, I have put the latest version (currently 2.2.1) version of Kwicks in the script directory of my child theme (minimatica-child beside the minimatica folder), and a copy of parent’s minimatica.js with a change to take in account the latest changes:


	jQuery('.kwicks').kwicks({
		maxSize: 600,
		behavior: 'menu' // No longer default
	});

(previously had only max:605 inside)
I also had to adjust the CSS:


/* kwicks */
#slides
{
	overflow: inherit;
	height: 410px;
	border-right: none;
}

ul#slides li:last-child
{
	border-right: #FFF 5px solid;
}
ul#slides li:only-child
{
	border-right: none;
}

.kwicks.kwicks-processed > *
{
	margin: 0;
	position: absolute;
}

#nav-slider .nav-previous
{
	right: -40px;
}
#nav-slider .nav-next
{
	left: -40px;
}

To the author: feel free to use information there if you want to update the theme with the latest version of Kwicks. Small contribution to this nice theme.