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
<script> | |
/** | |
* Activate swiper.js for testimonials | |
*/ | |
doHeroSlider(); | |
function doHeroSlider() { | |
// get hero slider element | |
const heroSlider = document.getElementById('heroSlider'); | |
// shut it down if slider isn't present |
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
## 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 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 | |
add_filter( 'generate_page_hero_background_image_url', function( $url ) { | |
$headers = array( | |
esc_url(get_field('radnomizer_image_one')), | |
esc_url(get_field('radnomizer_image_two')), | |
esc_url(get_field('radnomizer_image_three')), | |
esc_url(get_field('radnomizer_image_four')), | |
esc_url(get_field('radnomizer_image_five')) | |
); |
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
/** | |
* Output the post title. | |
* [gpc_post_title] | |
*/ | |
add_shortcode( 'gpc_post_title', 'gpc_post_title_func' ); | |
function gpc_post_title_func() { | |
return get_the_title(); | |
} |
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 | |
$args = array( | |
'post_type' => 'custom_post_name' // including the post type name seems to make this not work! | |
'meta_key' => 'custom_field_name', | |
'orderby' => 'meta_value', | |
'order' => 'ASC', | |
'tax_query' => array( | |
array( | |
'taxonomy' => 'custom_tax_name', |
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
/** | |
* Output site tagline. | |
* [gp_site_tagline] | |
*/ | |
function gp_output_site_tagline_func() { | |
return get_bloginfo( 'description' ); | |
} | |
add_shortcode( 'gp_site_tagline', 'gp_output_site_tagline_func' ); |
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 | |
/** | |
* Enqueue specific CSS styles or javascript for a custom post type (cpt). | |
*/ | |
add_action( 'wp_enqueue_scripts', 'my_cpt_scripts' ); | |
function my_cpt_scripts() { | |
if ( is_singular( 'custom_post_type_name' ) || is_post_type_archive( 'custom_post_type_name' ) ) { | |
wp_enqueue_style( 'cpt-style', get_stylesheet_directory_uri() . '/css/your-cpt-style.css', false, '', 'all'); | |
} |
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
<?xml version="1.0" encoding="UTF-8"?> | |
<configuration> | |
<system.webServer> | |
<httpProtocol> | |
<customHeaders> | |
<remove name="Vary"></remove> | |
<add name="Vary" value="Accept-Encoding"></add> | |
</customHeaders> | |
</httpProtocol> | |
<staticContent> |
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
/** | |
* Add current user shortcode | |
*/ | |
add_shortcode( 'current-user' , 'gpc_get_current_user' ); | |
function gpc_get_current_user() { | |
$user = wp_get_current_user(); | |
return $user->display_name; | |
} | |
/** |
NewerOlder