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 | |
$custom_args = array( | |
// Declare your parameters. For example: | |
'post_type' => 'post', | |
'posts_per_page' => '4', | |
'orderby' => 'date', | |
'order' => 'DESC' |
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 | |
/** | |
* Usage: | |
* Paste a gist link into a blog post or page and it will be embedded eg: | |
* https://gist.github.com/2926827 | |
* | |
* If a gist has multiple files you can select one using a url in the following format: | |
* https://gist.github.com/2926827?file=embed-gist.php | |
*/ |
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 | |
/** | |
* WordPress Query Comprehensive Reference | |
* Compiled by luetkemj - luetkemj.com | |
* | |
* CODEX: http://codex.wordpress.org/Class_Reference/WP_Query#Parameters | |
* Source: https://core.trac.wordpress.org/browser/tags/3.9/src/wp-includes/query.php | |
*/ | |
$args = array( |
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 | |
/*------------------------------------------------------------------------------------------------------------------------- | |
WordPress Config Master | |
-------------------------------------------------------------------------------------------------------------------------*/ | |
// PHP Info |
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
# BEGIN WordPress | |
<IfModule mod_rewrite.c> | |
RewriteEngine On | |
RewriteBase / | |
RewriteRule ^index\.php$ - [L] | |
RewriteRule ^([_0-9a-zA-Z-]+/)?wp-admin$ $1wp-admin/ [R=301,L] | |
RewriteCond %{REQUEST_FILENAME} -f [OR] | |
RewriteCond %{REQUEST_FILENAME} -d |
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 | |
/** | |
* keeps a user always logged in | |
* don't use this on a production site, ever! | |
*/ | |
add_action('init', 'auto_login'); | |
add_action('admin_init', 'auto_login'); | |
function auto_login() { |
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 | |
/* | |
* Force URLs in srcset attributes into HTTPS scheme. | |
*/ | |
add_filter( 'wp_calculate_image_srcset', function( $sources ) { | |
foreach ( $sources as &$source ) { | |
$source['url'] = set_url_scheme( $source['url'], 'https' ); | |
} |
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 | |
/** | |
* | |
* Filter post slug | |
* This needs saving as post meta to use that value rather than regenerate a new one | |
* | |
**/ | |
add_filter( 'wp_unique_post_slug', function( $slug, $post_ID, $post_status, $post_type, $post_parent, $original_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
<?php | |
function _get_current_page_url() { | |
global $wp; | |
return esc_url( home_url( $wp->request ) ); | |
} |
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 | |
if ( defined( 'LOCAL_DEV' ) && LOCAL_DEV ) { | |
// Allow Self Signed SSL Certificates | |
add_filter('https_ssl_verify', '__return_false'); | |
add_filter('https_local_ssl_verify', '__return_false'); | |
} |
OlderNewer