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
/* open up chrome dev tools (Menu > More tools > Developer tools) | |
* go to network tab, refresh the page, wait for images to load (on some sites you may have to scroll down to the images for them to start loading) | |
* right click/ctrl click on any entry in the network log, select Copy > Copy All as HAR | |
* open up JS console and enter: var har = [paste] | |
* (pasting could take a while if there's a lot of requests) | |
* paste the following JS code into the console | |
* copy the output, paste into a text file | |
* open up a terminal in same directory as text file, then: wget -i [that file] | |
*/ |
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 | |
// Taken pretty much from https://www.elegantthemes.com/blog/tips-tricks/using-the-wordpress-debug-log | |
// error_log info on php site - http://php.net/manual/en/function.error-log.php | |
// Just stick this function in your functions.php if you like :) | |
if ( ! function_exists('write_log')) { | |
function write_log ( $log ) { | |
if ( is_array( $log ) || is_object( $log ) ) { | |
// error_log - Sends an error message to the web server's error log or to a file. | |
error_log( print_r( $log, 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 | |
// Basically we need to make sure we load ALL our stylesheets for our child theme AFTER bootstrap | |
// that way we can override bootstrap without using crappy !important overrides, etc. | |
// This sample uses the transportex theme but just replace that for your own theme. | |
function my_theme_enqueue_styles() { | |
$parent_style = 'transportex-style'; // This is 'twentyfifteen-style' for the Twenty Fifteen theme. |
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 isHttps = location.protocol.match(/https/); | |
var http = isHttps ? 'https://' : 'http://'; | |
var site_url = http + location.host + '/yoursite'; | |
$(function(){ | |
$('#form-btn').on('click',function(event){ | |
var email_test = /^(([^<>()[\]\\.,;:\s@\"]+(\.[^<>()[\]\\.,;:\s@\"]+)*)|(\".+\"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/; | |
var form_name = $('#form-name').val(); | |
var form_email = $('#form-email').val(); |
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 isHttps = location.protocol.match(/https/); | |
var http = isHttps ? 'https://' : 'http://'; | |
var site_url = http + location.host + '/webpage'; |
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 | |
function limit_text($text, $limit) { | |
if (str_word_count($text, 0) > $limit) { | |
$words = str_word_count($text, 2); | |
$pos = array_keys($words); | |
$text = substr($text, 0, $pos[$limit]) . '...'; | |
} | |
return $text; | |
} |
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
//functions.php | |
function namespace_add_custom_types( $query ) { | |
if( is_category() || is_tag() && empty( $query->query_vars['suppress_filters'] ) ) { | |
$query->set( 'post_type', array( | |
'post', 'your-custom-post-type-here' | |
)); | |
return $query; | |
} | |
} |
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
//Define site URLS | |
define('WP_SITEURL', 'http://www.yoursite.net'); | |
define('WP_HOME', 'http://www.yoursite.net'); | |
//Change revision limits to keep database from overflowing | |
define( 'WP_POST_REVISIONS', 5 ); | |
//Change to force SSL | |
define( 'FORCE_SSL_LOGIN', false ); |