This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
As you know we’ve redesigned the product gallery feature in WooCommerce to deliver a richer experience in 3.0. | |
This is a significant frontend change that can be broken down in to three separate new features; | |
Image zoom / magnification | |
Lightbox | |
Slider | |
To enable each of these features in your theme you must declare support using add_theme_support() like so; | |
add_action( 'after_setup_theme', 'yourtheme_setup' ); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* | |
Theme Name: Twenty Fifteen Child | |
Theme URI: http://example.com/twenty-fifteen-child/ | |
Description: Twenty Fifteen Child Theme | |
Author: John Doe | |
Author URI: http://example.com | |
Template: twentyfifteen | |
Version: 1.0.0 | |
License: GNU General Public License v2 or later |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
if ( ! defined( 'ABSPATH' ) ) { | |
exit; // Exit if accessed directly | |
} | |
? |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* http://meyerweb.com/eric/tools/css/reset/ | |
v2.0-modified | 20110126 | |
License: none (public domain) | |
*/ | |
html, body, div, span, applet, object, iframe, | |
h1, h2, h3, h4, h5, h6, p, blockquote, pre, | |
a, abbr, acronym, address, big, cite, code, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Register a custom post type called "book". | |
* | |
* @see get_post_type_labels() for label keys. | |
*/ | |
function intensiv_custom_post_type_gallery() { | |
$labels = array( | |
'name' => _x( 'Galleries', 'Post type general name', textdomain' ), | |
'singular_name' => _x( 'Gallery', 'Post type singular name', 'textdomain' ), | |
); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//HTML | |
<div class="slider"> | |
<img src="https://source.unsplash.com/random" alt="" /> | |
<img src="https://source.unsplash.com/category/nature" alt="" /> | |
<img src="https://source.unsplash.com/category/food" alt="" /> | |
<img src="https://source.unsplash.com/category/people" alt="" /> | |
</div> | |
//CSS |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$(document).ready( function(){ | |
$('#trigger').click( function(event){ | |
event.stopPropagation(); | |
$('#drop').toggle(); | |
}); | |
// this is the most important part | |
$(document).click( function(){ | |
$('#drop').hide(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* localize script */ | |
wp_enqueue_script( 'settings', get_template_directory_uri() . '/js/settings.js', array('jquery'), OO_Version, true ); | |
wp_localize_script( 'settings', 'localized', array( | |
'ajaxurl' => admin_url( 'admin-ajax.php' ) | |
)); | |
/* setting.js */ | |
jQuery(function($){ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
HTML | |
index.html | |
------------------------------- | |
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8"> | |
<title>AJAX Contact Form Demo</title> | |
<link rel="stylesheet" href="style.css"> |