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
| Sitemap: https://www.example.com/sitemap_index.xml | |
| User-agent: * | |
| Disallow: /?s=* | |
| Disallow: /wp-admin/ | |
| Allow: /wp-admin/admin-ajax.php | |
| Allow: /wp-admin/images/ | |
| Allow: /wp-admin/css/ | |
| Allow: /wp-admin/js/ |
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
| function first_amp_ad() { | |
| return '<amp-ad | |
| layout="fixed-height" | |
| height=100 | |
| type="adsense" | |
| type="amp_ad" | |
| data-ad-client="ca-pub-xxxxxxxxxxxxxx" | |
| data-ad-slot="xxxxxxxxx"> | |
| </amp-ad>'; | |
| } |
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 | |
| // Callbacks for adding AMP-related things to the main theme | |
| /** Using comment syntax at amp/includes/amp-frontend-actions.php file. | |
| add_action( 'wp_head', 'amp_frontend_add_canonical' ); | |
| function amp_frontend_add_canonical() { | |
| if ( false === apply_filters( 'amp_frontend_show_canonical', true ) ) { | |
| return; | |
| } |
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
| # Leverage Browser Caching by setting HTTP header expires | |
| <IfModule mod_expires.c> | |
| ExpiresActive on | |
| ExpiresDefault "access plus 0 seconds" | |
| # CSS | |
| ExpiresByType text/css "access plus 1 month" | |
| # Data Interchange | |
| ExpiresByType application/json "access plus 0 seconds" |
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
| <link rel='stylesheet' href='https://maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css?ver=4.8.2' type='text/css' /> | |
| <a class="back-to-top" title="Page Up" style="color: #eadede; font-size:32px; position: fixed; bottom:20px; right:15px;" href="#top"><i class="fa fa-arrow-circle-up" aria-hidden="true"></i></a> | |
| <script> | |
| var jQuerybackToTop = jQuery(".back-to-top"); | |
| jQuerybackToTop.hide(); | |
| jQuery(window).on('scroll', function() { | |
| if (jQuery(this).scrollTop() > 400) { // Show button after X scroll | |
| jQuerybackToTop.fadeIn(); | |
| } else { | |
| jQuerybackToTop.fadeOut(); |
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
| RewriteEngine On | |
| RewriteCond %{HTTP:X-Forwarded-Proto} =https | |
| RewriteRule ^(.*)$ http://%{HTTP_HOST}%{REQUEST_URI} [L,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
| define('SP_REQUEST_URL', ($_SERVER['HTTPS'] ? 'https://' : 'http://') . $_SERVER['HTTP_HOST']); | |
| define('WP_SITEURL', SP_REQUEST_URL); | |
| define('WP_HOME', SP_REQUEST_URL); |
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
| // Untested: May not work with some Cache plugin. | |
| $country_code = $_SERVER["HTTP_CF_IPCOUNTRY"]; | |
| if ($country_code == "US") { | |
| echo "<style>.aicp {display:none;}</style>"; | |
| }else { | |
| echo "<script async src=\"//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js\"></script>"; | |
| } | |
| // Block multiple countries | |
| <?php |
OlderNewer