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
/* | |
Make the Facebook Like box responsive (fluid width) | |
https://developers.facebook.com/docs/reference/plugins/like-box/ | |
*/ | |
/* This element holds injected scripts inside iframes that in some cases may stretch layouts. So, we're just hiding it. */ | |
#fb-root { | |
display: none; | |
} |
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 | |
/** | |
* Return an ID of an attachment by searching the database with the file URL. | |
* | |
* First checks to see if the $url is pointing to a file that exists in | |
* the wp-content directory. If so, then we search the database for a | |
* partial match consisting of the remaining path AFTER the wp-content | |
* directory. Finally, if a match is found the attachment ID will be | |
* returned. | |
* |
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
function FBshares(url) { | |
var jsondata = UrlFetchApp.fetch("http://graph.facebook.com/"+url); | |
var object = Utilities.jsonParse(jsondata.getContentText()); | |
return object.shares; | |
} | |
function Tweets(url) { | |
var jsondata = UrlFetchApp.fetch("http://urls.api.twitter.com/1/urls/count.json?url="+url); | |
var object = Utilities.jsonParse(jsondata.getContentText()); | |
return object.count; |
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
var debug = process.env.NODE_ENV !== "production"; | |
var webpack = require('webpack'); | |
module.exports = { | |
context: __dirname, | |
devtool: debug ? "inline-sourcemap" : null, | |
entry: "./js/scripts.js", | |
output: { | |
path: __dirname + "/js", | |
filename: "scripts.min.js" |
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
https://wordpress.org/support/topic/w3-total-cache-how-to-disable-minify-css-in-a-particular-template/ | |
Well, just add this line at the top of the template page : | |
define('DONOTMINIFY', true); |
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 | |
/** | |
* Available Font Awesome icons | |
* | |
* Get all icons from a font-awesome.css file and list in json mode | |
* | |
* @author Alessandro Gubitosi <[email protected]> | |
* @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public License, version 3 | |
*/ |
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
/** | |
* Gets an attachement image as lazy loaded img based on ID | |
* @param string $size Thumbnail, medium, large, original, or {custom size} | |
* @param string $class CSS class name for the img tag | |
* @param integer $attachment_id ID of the attachment | |
* @param string $attachment_id The custom src atrribute to use, default to data-echo | |
* @return string Lazyload friendly HTML img tag | |
*/ | |
function get_attachemt_lazy($attachment_id = "", $size, $class, $src_attr = "data-echo") | |
{ |
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 | |
add_filter( 'theme_page_templates', 'child_theme_remove_page_template' ); | |
/** | |
* Remove page templates inherited from the parent theme. | |
* | |
* @param array $page_templates List of currently active page templates. | |
* | |
* @return array Modified list of page templates. | |
*/ | |
function child_theme_remove_page_template( $page_templates ) { |
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 | |
/** | |
* Remove Class Filter Without Access to Class Object | |
* | |
* In order to use the core WordPress remove_filter() on a filter added with the callback | |
* to a class, you either have to have access to that class object, or it has to be a call | |
* to a static method. This method allows you to remove filters with a callback to a class | |
* you don't have access to. | |
* | |
* Works with WordPress 1.2+ (4.7+ support added 9-19-2016) |
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
"production" : { | |
"key" : "./ssh/id_rsa", | |
"user" : "node", | |
"host" : "212.83.163.1", | |
"ref" : "origin/master", | |
"repo" : "[email protected]:repo.git", | |
"path" : "/var/www/production", | |
"post-deploy" : "pm2 startOrRestart ecosystem.json --env production" | |
}, |