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 | |
function add_scripts() { | |
wp_deregister_script( 'jquery' ); | |
wp_register_script( 'jquery', | |
'//ajax.googleapis.com/ajax/libs/jqueryui/1.10.3/jquery-ui.min.js'); | |
wp_enqueue_script( 'jquery' ); | |
} | |
add_action('wp_enqueue_scripts', 'add_scripts'); | |
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
move/rename a folder: mv /home/user/oldname /home/user/newname | |
Delete a folder with files: rm -rf Folder_name | |
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 | |
// paste this section in your functions.php | |
function j_add_this_social() { | |
return '<div class="addthis_toolbox addthis_default_style "> | |
<a class="addthis_button_facebook_like" fb:like:layout="button_count"></a> | |
<a class="addthis_button_tweet"></a> | |
<a class="addthis_button_pinterest_pinit" pi:pinit:layout="horizontal"></a> | |
<a class="addthis_counter addthis_pill_style"></a> | |
</div> | |
<script type="text/javascript">var addthis_config = {"data_track_addressbar":true};</script> |
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 | |
/*** | |
*** @Get youtube video ID from url | |
***/ | |
function get_youtube_id_from_url($url) { | |
$pattern = | |
'%^# Match any youtube URL | |
(?:https?://)? # Optional scheme. Either http or https | |
(?:www\.)? # Optional www subdomain | |
(?: # Group host alternatives |
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
var doEqualHeights = function (parentNodeSelector, childNodeSelector) { | |
var $nodes = $(parentNodeSelector); | |
$.each($nodes, function (index,node) { | |
var children = $(node).find(childNodeSelector); | |
var childHeight = 0; | |
$.each(children, function (index, child) { | |
var currentHeight = $(child).height(); | |
if(currentHeight > childHeight) { | |
childHeight = currentHeight; |
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 | |
/* | |
* Stripe Supported Currencies | |
* - JCB, Discover, and Diners Club cards can only be charged in USD | |
* - Currencies marked with * are not supported by American Express | |
* - Most alternative payment methods can only be used with a single currency | |
* - Brazilian Stripe accounts (currently in Preview) can only charge in Brazilian Real | |
* - Mexican Stripe accounts (currently in Preview) can only charge in Mexican Peso | |
* - Data from https://stripe.com/docs/currencies#charge-currencies | |
* - Last Update: July 20, 2017 |
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
[ | |
{ | |
"country": "US", | |
"zip": 34034, | |
"city": "APO", | |
"FIELD4": "", | |
"state": "AA", | |
"state_name": "Dillon", | |
"code": 33, | |
"FIELD8": "", |
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 | |
function addInlineVars($vars, $table_id) { | |
if(function_exists('wp_add_inline_script')) { | |
wp_add_inline_script( 'script_handle', 'window.ninja_footables.tables["table_'.$table_id.'"] = '.$vars.';'); | |
} else { | |
add_action('wp_footer', function () use ($vars, $table_id) { | |
?> | |
<script type="text/javascript"> | |
window.ninja_footables.tables["table_<?php echo $table_id;?>"] = <?php echo $vars ?>; |
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
/* | |
Change the offset value based on your theme. If you have fixed with header then you may need to increase the value | |
This code snippet only work on https://wordpress.org/plugins/ninja-tables/ | |
*/ | |
jQuery(document).ready(function() { | |
jQuery('table.ninja_footable').on('click', '.footable-page-link', function (e) { | |
var offset = 50; | |
jQuery('html, body').animate({ | |
scrollTop: jQuery(this).closest('table.ninja_footable').offset().top - offset |
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
<div id="footable_parent_353" class="ninja_table_wrapper"> | |
<table class="ninja_table_pro"> | |
<thead> | |
<tr class="footable-filtering"> | |
<!-- Filtering Markup here --> | |
</tr> | |
<tr class="footable-header"> | |
<th class="ninja_column_0">Column 1</th> | |
<th class="ninja_column_1">Another Column</th> | |
</tr> |