Skip to content

Instantly share code, notes, and snippets.

View spyrosvl's full-sized avatar

Spyros Vlachopoulos spyrosvl

View GitHub Profile
// The function to trigger the marker click, 'id' is the reference index to the 'markers' array.
function markerClick(id){
google.maps.event.trigger(markers[id], 'click');
}
// this should be on the loop creating the markers
google.maps.event.addListener(marker, 'click', (function(marker, i) {
return function() {
infowindow.open(map, marker);
}
<?php
add_filter( 'facetwp_filtered_post_ids', 'car_zero_priced_last', 10, 2);
function car_zero_priced_last( $post_ids, $class ) {
if (!isset($class->ajax_params['http_params']['get']['fwp_sort'])) {
return $post_ids;
}
if (isset($class->ajax_params['http_params']['get']['fwp_sort']) && $class->ajax_params['http_params']['get']['fwp_sort'] != 'price_asc') {
return $post_ids;
<?php
add_filter( 'facetwp_filtered_post_ids', 'car_zero_priced_last', 10, 2);
function car_zero_priced_last( $post_ids, $class ) {
if (!isset($class->ajax_params['http_params']['get']['fwp_sort'])) {
return $post_ids;
}
if (isset($class->ajax_params['http_params']['get']['fwp_sort']) && $class->ajax_params['http_params']['get']['fwp_sort'] != 'price_asc') {
return $post_ids;
@spyrosvl
spyrosvl / isotope infinite load.js
Last active March 20, 2018 10:53
isotope infinite load
jQuery(document).ready(function() {
jQuery(function(){
var $grid = jQuery(".isotope");
$grid.isotope();
jQuery(window).trigger('resize');
console.log('triggered resize');
var count = 2;
var total = 251;
@spyrosvl
spyrosvl / override-Essential_Addons_Elementor-template-render-output.php
Last active April 4, 2023 12:41
How to override Elementor Essentials Addons template render output
<?php
/*
an example of how to add an extra field to an elementor section
and then override the ouput of the Elementor Essentials Addons template render
this should go to your child theme functions.php
More info at: https://www.nitroweb.gr/how-to-override-elementor-essentials-addons-template-render-output/
*/
add_action( 'elementor/element/before_section_end', function( $element, $section_id, $args ) {
/** @var \Elementor\Element_Base $element */