This file contains 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
"no-empty-source": null, | |
"declaration-empty-line-before": null, | |
"color-hex-case": null, | |
"block-closing-brace-empty-line-before": null, | |
"no-missing-end-of-source-newline": null, |
This file contains 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 | |
/* | |
Plugin Name: WordPress.org Plugin | |
Plugin URI: https://fullstackwp.com | |
Description: Basic WordPress Plugin Header Comment | |
Version: 0.1 | |
Author: Varun Kumar | |
Author URI: https://fullstackwp.com/ | |
License: GPL2 | |
License URI: https://www.gnu.org/licenses/gpl-2.0.html |
This file contains 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
## ENABLE GZIP COMPRESSION ## | |
AddOutputFilterByType DEFLATE text/plain | |
AddOutputFilterByType DEFLATE text/html | |
AddOutputFilterByType DEFLATE text/xml | |
AddOutputFilterByType DEFLATE text/css | |
AddOutputFilterByType DEFLATE application/xml | |
AddOutputFilterByType DEFLATE application/xhtml+xml | |
AddOutputFilterByType DEFLATE application/rss+xml | |
AddOutputFilterByType DEFLATE application/javascript | |
AddOutputFilterByType DEFLATE application/x-javascript |
This file contains 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 | |
/** | |
* Add custom taxonomy for project services | |
*/ | |
add_action( 'init', 'services', 0); | |
function services() { | |
$labels = array( | |
'name' => _x( 'Services', 'taxonomy general name', 'textdomain' ), | |
'singular_name' => _x( 'Service', 'taxonomy singular name', 'textdomain' ), |
This file contains 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
$('form').submit(function(e) { | |
// get the form data | |
formData = $(this).serialize(); | |
formData += '&action=submit_contact_form'; | |
// process the form | |
$.ajax({ | |
type : 'post', | |
url : localData.ajax_url, |
This file contains 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 | |
add_action( 'wp_ajax_action_slug', 'action_slug' ); | |
add_action( 'wp_ajax_nopriv_action_slug', 'action_slug' ); | |
function action_slug() { | |
check_ajax_referer('form_nonce'); | |
$errors = array(); // Array to hold validation errors | |
$data = array(); // Array to pass back data |
This file contains 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 | |
add_action( 'wp_enqueue_scripts', 'slug_add_scripts' ); | |
/** | |
* Register and enqueue scripts and styles. | |
*/ | |
function slug_add_scripts() { | |
// enqueuing a stylesheet | |
// params - $handle, $src, $deps, $version, $media |
This file contains 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 | |
// Using init action hook to register post type on loading | |
add_action( 'init', 'slug_book_init'); | |
/** | |
* Register a book post type | |
*/ | |
function slug_book_init() { | |
$labels = array( | |
'name' => _x( 'Books', 'post type general name', 'textdomain' ), | |
'singular_name' => _x( 'Book', 'post type singular name', 'textdomain' ), |
This file contains 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 | |
/** | |
* WordPress Query Comprehensive Reference | |
* Compiled by luetkemj - luetkemj.com | |
* | |
* CODEX: http://codex.wordpress.org/Class_Reference/WP_Query#Parameters | |
* Source: https://core.trac.wordpress.org/browser/tags/3.9/src/wp-includes/query.php | |
*/ | |
$args = array( |
This file contains 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
$thumbnail_id = get_woocommerce_term_meta( $product_cat->term_id, 'thumbnail_id', true ); | |
// get the image thumbnail for any size | |
$image = wp_get_attachment_image_src( $thumbnail_id, 'small' ); | |
echo '<img src = "' . $image[0] . '" />'; |
NewerOlder