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 | |
/** | |
* | |
* Genrate Slugs from Title or any given string | |
* | |
* @param string $str | |
* @return Slug | |
* | |
**/ |
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
Theme Files | |
style.css – This is your theme’s stylesheet file. | |
index.php – This is the main body template for your theme. Its job is to bring together all the information in the other theme files using template tags. | |
header.php – This file contains the header information that appears with the <head> section of your site, stuff like metadata and the link to your stylesheet. | |
sidebar.php – Everything in you sidebar goes in this file, like widgets, categories, additional menus, search form, etc. | |
footer.php – This file contains your footer information, such as copyright details, widgets, and social icons. | |
single.php – This file displays just one post. | |
page.php – When you create a page on your site, this is the template responsible. | |
comments.php – This file is responsible for displaying comments. |
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
Activating WooCommerce Lightbox, Gallery Slider, Zoom | |
Activating WooCommerce Lightbox, Gallery Slider, Zoom is quite simple by adding: | |
add_action( 'after_setup_theme', 'mytheme_setup' ); | |
function mytheme_setup() { | |
add_theme_support( 'wc-product-gallery-zoom' ); | |
add_theme_support( 'wc-product-gallery-lightbox' ); | |
add_theme_support( 'wc-product-gallery-slider' ); | |
} |
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 | |
/** | |
* Register product custom post type | |
* @return void | |
*/ | |
function alcolock_product_cpt() { | |
$labels = array( | |
'name' => _x( 'Products', 'Post Type General Name', 'alcolock' ), |
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
/* | |
* Function for post duplication. Dups appear as drafts. User is redirected to the edit screen | |
* Does not work for CPT! | |
*/ | |
function rd_duplicate_post_as_draft(){ | |
global $wpdb; | |
if (! ( isset( $_GET['post']) || isset( $_POST['post']) || ( isset($_REQUEST['action']) && 'rd_duplicate_post_as_draft' == $_REQUEST['action'] ) ) ) { | |
wp_die('No post to duplicate has been supplied!'); | |
} | |
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
(function(f){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=f()}else if(typeof define==="function"&&define.amd){define([],f)}else{var g;if(typeof window!=="undefined"){g=window}else if(typeof global!=="undefined"){g=global}else if(typeof self!=="undefined"){g=self}else{g=this}g.Slideout = f()}})(function(){var define,module,exports;return (function(){function r(e,n,t){function o(i,f){if(!n[i]){if(!e[i]){var c="function"==typeof require&&require;if(!f&&c)return c(i,!0);if(u)return u(i,!0);var a=new Error("Cannot find module '"+i+"'");throw a.code="MODULE_NOT_FOUND",a}var p=n[i]={exports:{}};e[i][0].call(p.exports,function(r){var n=e[i][1][r];return o(n||r)},p,p.exports,r,e,n,t)}return n[i].exports}for(var u="function"==typeof require&&require,i=0;i<t.length;i++)o(t[i]);return o}return r})()({1:[function(require,module,exports){ | |
'use strict'; | |
/** | |
* Module dependencies | |
*/ | |
var decouple = require('decouple'); | |
var Emitter = require('emitter'); | |
/** |