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 | |
| /** | |
| * Prevent Contact Form 7 javascript and styles from loading on every page | |
| * Load them only on pages that contain the CF7 shortcode! | |
| * @author @david <david@davidvandenbor.nl> | |
| */ | |
| function david_dequeue_scripts() { | |
| $load_scripts = false; | |
| if( is_singular() ) { |
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 | |
| /* Basic WP SEO | |
| Usage: | |
| 1. add this code to functions.php | |
| 2. replace the $default_keywords with your own | |
| 3. add <?php echo basic_wp_seo(); ?> to header.php | |
| 4. test well and fine tune as needed | |
| Optional: add custom description, keywords, and/or title | |
| to any post or page using these custom field keys: |
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 | |
| /** The standard call to display all meta data. | |
| * The function returns HTML code. Fields are shown in a list. | |
| * <ul class='post-meta'> | |
| * <li><span class='post-meta-key'>Meta Key</span> Value</li> | |
| * </ul> | |
| */ | |
| the_meta(); ?> | |
| <?php |
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
| # hide index.php from the domain URL | |
| # for WordPress users: Permalink URL canonicalization is automated via PHP in WordPress 2.3+ | |
| RewriteEngine On | |
| RewriteCond %{THE_REQUEST} ^GET.*index\.php [NC] | |
| RewriteRule (.*?)index\.php/*(.*) /$1$2 [R=301,NE,L] | |
| # parked domains permanent 301 redirect so search engines not to treat them as duplicate content. | |
| RewriteEngine on | |
| RewriteCond %{HTTP_HOST} !^www.maindomain.com$ | |
| RewriteRule ^(.*)$ http://www.maindomain.com/$1 [R=301] |
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 | |
| // Limit the number of revisions that posts and pages can make | |
| // Put this in your wp_config.php | |
| define( 'WP_POST_REVISIONS', 1 ); | |
| // to disable all revisions except the autosave | |
| define('WP_POST_REVISIONS', false); | |
| ?> |
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 | |
| /** | |
| * Enqueue Googl Fonts | |
| * @author @david | |
| */ | |
| function google_fonts() { | |
| $query_args = array( | |
| 'family' => 'Open+Sans:400,700|Oswald:700', | |
| 'subset' => 'latin,latin-ext' |
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 | |
| // WARNING: query_posts() will change your main query and is not recommended | |
| // for secondary loops! Only use if absolutely necessary!!!! | |
| // Creating a new instance of WP_Query or get_posts() is preferred for secondary loops. | |
| // Check lines 10 and 22: | |
| // Line 1 is telling WordPress to only display 1 post, | |
| // which will automatically be the most recent one. | |
| // On Line 22 we are telling WordPress to offset the posts by 1, | |
| // which means it will not repeat the post output in the first loop. |
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
| <!DOCTYPE html> | |
| <html lang="en"> | |
| <head> | |
| <title>Responsive Web Design Pattern: Mostly Fluid</title> | |
| <meta charset="utf-8"> | |
| <meta name="viewport" content="width=device-width, initial-scale=1"> | |
| <meta http-equiv="cleartype" content="on"> | |
| <link rel="stylesheet" href="/web/fundamentals/resources/samples/css/normalize.css"> |
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
| <!DOCTYPE html> | |
| <html> | |
| <head> | |
| <meta charset="utf-8"> | |
| <meta http-equiv="X-UA-Compatible" content="IE=edge"> | |
| <title></title> | |
| <link rel="stylesheet" href=""> | |
| <script> | |
| $('a.taphover').on("touchstart", function (e) { |
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
| @import "foundation/components/grid"; | |
| .layout { | |
| // `layout` container functions as a row | |
| @include grid-row(); | |
| } | |
| .layout-content { | |
| // Mobile-first: make `layout-container` full-width | |
| @include grid-column(12); |