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
| /* Ajax Function */ | |
| add_action("wp_ajax_my_ajax_action", "my_ajax_handler"); | |
| add_action("wp_ajax_nopriv_my_ajax_action", "my_ajax_handler"); | |
| function my_ajax_handler() { | |
| $args = array( | |
| 'post_type' => 'post', | |
| 'post_status' => 'publish', |
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 | |
| /* | |
| Template Name: Ajax Demo | |
| */ | |
| <h3>Simple AJAX in Wordpress Demo</h3> | |
| <button id="triggerajax" onclick="fetchposts()">Click to Fetch Posts</button> | |
| <div id="postcontainer"></div> |
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> | |
| <!-- Bootstrap CSS --> | |
| <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css" > | |
| <!-- Fontawesome CSS --> | |
| <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css"> | |
| <script src="https://cdnjs.cloudflare.com/ajax/libs/lazysizes/5.1.0/lazysizes.min.js" ></script> | |
| </head> | |
| <body> |
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
| <script type="application/ld+json"> | |
| { | |
| "@context": "https://schema.org", | |
| "@type": "Organization", | |
| "url": "http://www.example.com", | |
| "name": "Unlimited Ball Bearings Corp.", | |
| "contactPoint": { | |
| "@type": "ContactPoint", | |
| "telephone": "+1-401-555-1212", | |
| "contactType": "Customer service" |
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
| # BEGIN WordPress | |
| <IfModule mod_rewrite.c> | |
| RewriteEngine On | |
| RewriteBase / | |
| RewriteRule ^index.php$ - [L] | |
| RewriteCond %{REQUEST_FILENAME} !-f | |
| RewriteCond %{REQUEST_FILENAME} !-d | |
| RewriteRule . /index.php [L] | |
| </IfModule> | |
| # END WordPress |
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
| ssh -i /path/my-key-pair.pem my-instance-user-name@my-instance-public-dns-name |
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 sendEmails() { | |
| var emailAddress = 'someone@example.com'; | |
| var subject = 'Subject Line'; | |
| var message = 'Your message here'; | |
| MailApp.sendEmail(emailAddress, subject, message, { | |
| htmlBody: message, | |
| cc : 'cc@example.com', | |
| bcc : 'bcc@example.com' | |
| }); |
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
| <IfModule mod_deflate.c> | |
| # Compress HTML, CSS, JavaScript, Text, XML and fonts | |
| AddOutputFilterByType DEFLATE application/javascript | |
| AddOutputFilterByType DEFLATE application/rss+xml | |
| AddOutputFilterByType DEFLATE application/vnd.ms-fontobject | |
| AddOutputFilterByType DEFLATE application/x-font | |
| AddOutputFilterByType DEFLATE application/x-font-opentype | |
| AddOutputFilterByType DEFLATE application/x-font-otf | |
| AddOutputFilterByType DEFLATE application/x-font-truetype | |
| AddOutputFilterByType DEFLATE application/x-font-ttf |
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
| ## EXPIRES CACHING ## | |
| <IfModule mod_expires.c> | |
| ExpiresActive On | |
| ExpiresByType image/jpg "access 1 year" | |
| ExpiresByType image/jpeg "access 1 year" | |
| ExpiresByType image/gif "access 1 year" | |
| ExpiresByType image/png "access 1 year" | |
| ExpiresByType text/css "access 1 month" | |
| ExpiresByType text/html "access 1 month" | |
| ExpiresByType application/pdf "access 1 month" |
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
| #force https: | |
| RewriteEngine On | |
| RewriteCond %{HTTP_HOST} ^example\.com [NC] | |
| RewriteCond %{SERVER_PORT} 80 | |
| RewriteRule ^(.*)$ https://www.example.com/$1 [R=301,L] | |
| #Force http: | |
| RewriteEngine On | |
| RewriteCond %{HTTPS} on | |
| RewriteRule ^ http://%{HTTP_HOST}%{REQUEST_URI} [L,R=301] |
OlderNewer