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 //* mind this opening php tag | |
/** | |
* This snippet returns a list of all currently hooked functions. | |
* It is set up to output this data on a specific page. Do not output this data publicly. | |
* Use this snippet for debugging/testing/development. | |
* Source: http://www.rarst.net/wordpress/debug-wordpress-hooks/ | |
* Modified by Ren Ventura, EngageWP.com | |
**/ |
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 tags in the header */ | |
function lh_add_custom_tag_head() { | |
if( is_page( array( 1, 2, 3, 4, 5, 6, 7 ) ) ) { //replace these numbers with the ids of your pages ?> | |
<link href="http://hvsimage.com/canonical/morris-water-maze-mwm/solutions/ " rel="canonical" /> | |
<?php } | |
} | |
add_action( 'wp_head', 'lh_add_custom_tag_head' ); |
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
module['exports'] = function bot (hook) { | |
var request = require('request'); | |
var TOKEN = hook.env.bot_scheduler_token; | |
var ENDPOINT = 'https://api.telegram.org/bot' + TOKEN; | |
console.log(hook.params); | |
// generic handler to log api call responses | |
var handler = function (err, httpResponse, body) { | |
var response = JSON.stringify({ |
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
#301 Redirects for .htaccess | |
#Redirect a single page: | |
Redirect 301 /pagename.php http://www.domain.com/pagename.html | |
#Redirect an entire site: | |
Redirect 301 / http://www.domain.com/ | |
#Redirect an entire site to a sub folder | |
Redirect 301 / http://www.domain.com/subfolder/ |
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 | |
//Google Analytics E-commerce Tracking code | |
function your_prefix_google_ecommerce_tracking_code() { | |
$success_page = edd_get_option( 'success_page' ) ? is_page( edd_get_option( 'success_page' ) ) : false; | |
if ( ! $success_page || !edd_is_success_page() ){ | |
return; | |
} | |
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
/* Urdu font is available at https://github.com/logichub/urdu-fonts-support/tree/master/public/css/fonts | |
* Put following CSS code in your style.css or custom.css | |
* Copy fonts folder in your css file directory | |
*/ | |
@font-face { | |
font-family: 'Urdu'; | |
src: url('fonts/urdufont.eot'); | |
src: url('fonts/urdufont.eot?#iefix') format('embedded-opentype'), | |
url('fonts/urdufont.woff') format('woff'), |
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
The HTTP requests made by the premium plugins are really a huge pain. While I understand the purpose, I still don't get why they need to happen so often. | |
I have been struggling during a long time with this issue. Woo plugins, affiliate, etc. they all send requests even on page, post or custom posts pages. When their server is loaded, sit can easily take between 500ms to 2s. | |
Puneet, the only way to fix this has been to block all http request on specific pages by adding a filter 'pre_http_request'. | |
Here is a sample code: http://pastebin.com/5bji3rQG | |
This is not pretty but this should give you a starting point. | |
Before experimenting with this, you can always test by adding | |
define( 'WP_HTTP_BLOCK_EXTERNAL', TRUE ); |
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
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |
NewerOlder