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
// This hides page builder sections from users | |
// First add class to the body based on template, then target those classes with deisplay: none | |
function acf_admin_head_layout() { | |
?> | |
<style type="text/css"> | |
/* Remove borders on li since we not removing li's */ | |
.acf-fc-popup li { | |
border:0 !important; | |
} |
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 tend_product_listing( $original_template ) { | |
if ( is_tax( 'product_cat' ) ) { | |
$term = get_queried_object(); | |
$children = get_terms( $term->taxonomy, array( | |
'parent' => $term->term_id, | |
'hide_empty' => false, | |
) ); | |
if ( ! $children ) { | |
return wc_get_template_part( 'archive-product-listing' ); | |
} else { |
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
.gform_ajax_spinner { | |
margin-left: 20px; /* give it some space from the Submit button */ | |
border: 4px solid rgba(255, 255, 255, 0.3); /* match with border-left */ | |
border-left: 4px solid gold; | |
animation: spinner 1.1s infinite linear; | |
border-radius: 50%; | |
width: 30px; /* match with height for a circle */ | |
height: 30px; | |
} | |
@keyframes spinner { |
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 gf_spinner_replace( $image_src, $form ) { | |
return 'data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7'; // relative to you theme images folder | |
} | |
add_filter( 'gform_ajax_spinner_url', 'gf_spinner_replace', 10, 2 ); |
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
UPDATE wp_posts SET post_content = REPLACE(post_content, '“', '“'); | |
UPDATE wp_posts SET post_content = REPLACE(post_content, 'â€', '”'); | |
UPDATE wp_posts SET post_content = REPLACE(post_content, '’', '’'); | |
UPDATE wp_posts SET post_content = REPLACE(post_content, '‘', '‘'); | |
UPDATE wp_posts SET post_content = REPLACE(post_content, '—', '–'); | |
UPDATE wp_posts SET post_content = REPLACE(post_content, '–', '—'); | |
UPDATE wp_posts SET post_content = REPLACE(post_content, '•', '-'); | |
UPDATE wp_posts SET post_content = REPLACE(post_content, '…', '…'); | |
UPDATE wp_posts SET post_title = REPLACE(post_title, '“', '“'); |
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
// Check and return an SVG icon inline | |
// Adapted from https://jdsteinbach.com/wordpress/using-svgs-wordpress/ | |
// Needs SVG Support plugin as well | |
function tend_print_svg( $icon ) { | |
if ( false !== strpos( $icon, '.svg' ) ) { | |
$icon = str_replace( site_url(), '', $icon ); | |
include( ABSPATH . $icon ); | |
} | |
return $icon; | |
} |
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
//http://wordpress.stackexchange.com/questions/201657/wp-rest-api-fetch-posts-from-post-type | |
add_action( 'init', 'add_adverts_to_json_api', 30 ); | |
function add_adverts_to_json_api(){ | |
global $wp_post_types; | |
$wp_post_types['advert']->show_in_rest = true; | |
} |
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
$tax = 'property-type'; | |
$tax_terms = wp_get_object_terms( $post->ID, $tax ); | |
if (!empty( $tax_terms )) { | |
$term = array_pop($tax_terms); | |
_e('This is a ','turnerestates'); | |
echo '<a href="' . get_term_link( $term->slug, $tax ) . '">' . strtolower($term->name) . '</a>'; | |
_e(' property.','turnerestates'); | |
} |