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 my_customize_rest_cors() { | |
remove_filter( 'rest_pre_serve_request', 'rest_send_cors_headers' ); | |
add_filter( 'rest_pre_serve_request', function( $value ) { | |
header( 'Access-Control-Allow-Origin: *' ); | |
header( 'Access-Control-Allow-Methods: GET' ); | |
header( 'Access-Control-Allow-Credentials: true' ); | |
header( 'Access-Control-Expose-Headers: Link', false ); | |
header( 'Access-Control-Allow-Headers: X-Requested-With' ); |
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
# Exclude the files ajax, upload and WP CRON scripts from authentication | |
<FilesMatch "(admin-ajax\.php|media-upload\.php|async-upload\.php|wp-cron\.php|xmlrpc\.php)$"> | |
Order allow,deny | |
Allow from all | |
Satisfy any | |
</FilesMatch> |
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
// original from: http://mashe.hawksey.info/2014/07/google-sheets-as-a-database-insert-with-apps-script-using-postget-methods-with-ajax-example/ | |
// original gist: https://gist.github.com/willpatera/ee41ae374d3c9839c2d6 | |
function doGet(e){ | |
return handleResponse(e); | |
} | |
// Enter sheet name where data is to be written below | |
var SHEET_NAME = "Sheet1"; |
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 | |
/* Thanks to https://polyetilen.lt/en/resize-and-crop-image-from-center-with-php for this script */ | |
//resize and crop image by center | |
function resize_crop_image($max_width, $max_height, $source_file, $dst_dir, $quality = 80){ | |
$imgsize = getimagesize($source_file); | |
$width = $imgsize[0]; | |
$height = $imgsize[1]; | |
$mime = $imgsize['mime']; | |
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 | |
// Special pages ----------------- | |
$frontpage_id = get_option( 'page_on_front' ); | |
$blog_id = get_option( 'page_for_posts' ); | |
// Page templates ----------------- | |
$about_templates = get_pages(array( | |
'meta_key' => '_wp_page_template', | |
'meta_value' => 'page-about.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
input[type="text"]::-webkit-input-placeholder{ /* Chrome/Opera/Safari */ | |
color: pink; | |
} | |
input[type="text"]::-moz-placeholder { /* Firefox 19+ */ | |
color: pink; | |
} | |
input[type="text"]:-ms-input-placeholder { /* IE 10+ */ | |
color: pink; | |
} | |
input[type="text"]:-moz-placeholder { /* Firefox 18- */ |
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 | |
// Place this in your functions.php file | |
add_filter('wpcf7_form_action_url', 'wpcf7_custom_form_action_url'); | |
function wpcf7_custom_form_action_url(){ | |
return 'send.php';// replace this with the new action url (excluding the 'http://') | |
} | |
?> |
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 | |
/* Google Analytics */ | |
add_action('wp_head','add_google_analytics'); | |
function add_google_analytics() { ?> | |
<script> | |
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){ | |
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o), | |
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m) |
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
function load_custom_styles() { | |
wp_enqueue_style('style-css', get_template_directory_uri().'/style.css');// custom styles | |
} | |
add_action( 'wp_enqueue_scripts', 'load_custom_styles', 999 ); |
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
.infinite-zoom{ | |
-webkit-animation: zoomSlow 60s infinite linear; | |
-moz-animation: zoomSlow 60s infinite linear; | |
animation: zoomSlow 60s infinite linear; | |
} | |
@-webkit-keyframes zoomSlow { | |
0% { | |
-moz-transform: scale(1); | |
-webkit-transform: scale(1); |
NewerOlder