The popular open-source contract for web professionals by Stuff & Nonsense
- Originally published: 23rd December 2008
- Revised date: March 15th 2016
- Original post
$ git clone https://github.com/WordPress/meta-environment.git www/WordPress-meta-environment |
$ > .htaccess |
SELECT `wp_posts`.`ID`, `wp_posts`.`post_title`, `b`.`ID` as 'thumbnail' | |
FROM `wp_posts` | |
INNER JOIN ( | |
SELECT * | |
FROM `wp_postmeta` | |
WHERE `meta_key` = '_thumbnail_id' | |
) AS a ON `wp_posts`.`ID` = `a`.`post_id` | |
LEFT JOIN ( | |
SELECT * | |
FROM `wp_posts` |
<?php | |
add_filter( 'illegal_user_logins', 'cameronjonesweb_illegal_user_logins' ); | |
function cameronjonesweb_illegal_user_logins( $usernames ) { | |
$usernames[] = 'admin'; | |
return $usernames; |
<?php | |
function 404_page_title( $title, $id ) { | |
if( is_404() && !get_post_type( $id ) ) { | |
$title = 'Page not found'; | |
} | |
return $title; |
<?php | |
add_action( 'edit_form_after_title', 'posts_page_edit_form' ); | |
function posts_page_edit_form( $post ) { | |
$posts_page = get_option( 'page_for_posts' ); | |
if ( $posts_page === $post->ID ) { | |
// Running this hook seems to remove the page for posts notice, it's a good idea to keep it |
RewriteEngine On | |
# Replace example.com with the target domain | |
RewriteCond %{HTTP_HOST} !example.com$ [NC] | |
# Any paths you wish to exclude for some reason | |
RewriteCond %{REQUEST_URI} !^/training | |
# Preserve the path | |
RewriteRule ^(.*)$ http://example.com/$1 [L,R=301] | |
# All to the root | |
RewriteRule ^(.*)$ http://example.com/ [L,R=301] |
<IfModule mod_expires.c> | |
ExpiresActive On | |
ExpiresByType image/jpg "access plus 1 year" | |
ExpiresByType image/jpeg "access plus 1 year" | |
ExpiresByType image/gif "access plus 1 year" | |
ExpiresByType image/png "access plus 1 year" | |
ExpiresByType text/css "access plus 1 month" | |
ExpiresByType application/pdf "access plus 1 month" | |
ExpiresByType text/x-javascript "access plus 1 month" | |
ExpiresByType application/x-shockwave-flash "access plus 1 month" |
<!DOCTYPE html> | |
<head> | |
<?php wp_head(); ?> | |
</head> | |
<body <?php body_class(); ?>> | |
<?php var_dump( have_posts() ); ?> | |
<?php wp_footer(); ?> | |
</body> |