Skip to content

Instantly share code, notes, and snippets.

<?php get_header(); ?>
<main id="main-content">
<div class="search-object">
<div class="container d-flex">
<div class="form d-flex justify-content-end">
<div class="wrapper">
<?php echo do_shortcode('[searchandfilter id="42"]'); ?>
<form>
<div class="selects row">
<div class="col-xl-2 col-lg-6 col-md-6 col-sm-12">
<?php get_header(); ?>
<main id="main-content">
<div class="search-object">
<div class="container d-flex">
<div class="form d-flex justify-content-end">
<div class="wrapper">
<?php echo do_shortcode('[searchandfilter id="42"]'); ?>
<form>
<div class="selects row">
<div class="col-xl-2 col-lg-6 col-md-6 col-sm-12">
<?php
$storeData = [];
$args = array('post_type' => 'property');
$loop = new WP_Query($args);
foreach ( $loop->posts as $post ) {
$location = get_field('location');
$price = get_field('price');
$rentprice = get_field('rent_price');
$area_count = get_field('area');
$floors_count = get_field('floors');
<?php
/**
* Easyhome styles.
* Easyhome css/js assets.
*/
add_action('init', 'my_register_styles');
function my_register_styles() {
<?php
$storeData = [];
$args = array('post_type' => 'property');
$loop = new WP_Query($args);
foreach ( $loop->posts as $post ) {
$location = get_field('location');
$storeData[] = [
'title' => apply_filters('the_title', $post->post_title),
'lat' => $location['lat'],
'long' => $location['lng']
var j = storeData.length;
for (var i=0; i<j; i++) {
console.log(storeData[i].title);
}
var markers = [
{
coords:{lat: 56.9715833, lng: 23.9890814},
iconImage:'assets/img/map-marker.png',
content:'<div class="marker-pop-object">'+
@janisdonis
janisdonis / loop.php
Created April 25, 2018 15:14
Loop split
<ul>
<li><a href="#">Visas preces</a></li>
<?php
$childid = get_product_top_level_category ( get_the_ID());
$args = array(
'taxonomy' => 'product_cat',
'parent' => $childid
);
$terms = get_terms( $args );
$i = 1;
$terms = get_the_terms( $product->id, 'pa_vizualais-stavoklis');
foreach($terms as $term){
if($term->slug == 'jauns' || $term->slug == 'jauns-bez-kastes' || $term->slug == 'a-plus') {
$used = '<used>0</used>';
echo $used;
}
else {
$used = '<used>1</used>';
echo $used;
}
<?php
$url = 'http://redeemnordics.com/pricelist/JSON/json.php';
$json = file_get_contents($url);
$array = json_decode($json);
$array = (array) $array;
$products = array();
$xml = new SimpleXMLElement('<products/>');
$('.testimonials-slider').bxSlider({
slideWidth: 800,
minSlides: 1,
maxSlides: 1,
slideMargin: 32,
auto: true,
autoControls: true
});