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
add_shortcode('shortcode_find_takeaway', 'shortcode_find_takeaway'); | |
function shortcode_find_takeaway() { | |
$terms = get_terms( array( | |
'taxonomy' => 'towns-takeaway', | |
'hide_empty' => false, | |
) ); | |
if ( $terms && ! is_wp_error( $terms ) ) : | |
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://www.wpbeginner.com/wp-tutorials/how-to-use-shortcodes-in-your-wordpress-sidebar-widgets/ | |
add_filter('widget_text','do_shortcode'); | |
add_shortcode('shortcode_find_restaurant', 'shortcode_find_restaurant'); | |
function shortcode_find_restaurant() { | |
$terms = get_terms( array( | |
'taxonomy' => 'towns-restaurant', | |
'hide_empty' => false, |
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
header.php | |
<?php | |
if ( is_checkout() && ! empty( $wp->query_vars['order-received'] ) ) { | |
// echo $wp->query_vars['order-received']; | |
// Lets grab the order | |
$order = wc_get_order( $wp->query_vars['order-received'] ); |
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
HTML ---- | |
<div class="container well checking" style="max-width:700px"> | |
<h3>We are now searching for your desired availability</h3> | |
<img src='images/loading.svg' alt='Loading availability' width='120' height='120'> | |
// loading.svg made at: http://loading.io/ |
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
add_meta_box('nme_pro_reviews_box', 'Property Reviews', 'nme_pro_reviews_box', 'property', 'normal', 'high'); | |
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
$("img.lazy").lazyload({ | |
effect : "fadeIn", | |
threshold : 200, | |
event : "sporty" | |
}); | |
$('#order_az').click(function() { | |
$("img.lazy").trigger('sporty'); | |
}); |
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 | |
// // WordPress method - Start | |
// function get_json( $url, $arg ) { | |
// //GET remote site | |
// $response = wp_remote_get( $url, $arg ); | |
// //Checking for errors | |
// if ( is_wp_error( $response ) ) { | |
// return sprintf( 'Your URL %1s could not be retrieved', $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
http://snipplr.com/view.php?codeview&id=70656 | |
# First: | |
DELETE FROM wp_postmeta | |
WHERE post_id IN | |
( | |
SELECT id | |
FROM wp_posts | |
WHERE post_type = 'attachment' |
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 | |
<?php | |
$rows_pgr = get_field('property_gallery_repeater'); | |
if($rows_pgr) { | |
echo " | |
<div class='gallery'>"; | |
echo " <div id='property_gallery_container' class='grid' itemscope itemtype='http://schema.org/ImageGallery'>"; |