Skip to content

Instantly share code, notes, and snippets.

Avatar

Spyros Vlachopoulos spyrosvl

View GitHub Profile
@spyrosvl
spyrosvl / override-Essential_Addons_Elementor-template-render-output.php
Last active Jun 2, 2020
How to override Elementor Essentials Addons template render output
View override-Essential_Addons_Elementor-template-render-output.php
<?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 */
@spyrosvl
spyrosvl / isotope infinite load.js
Last active Mar 20, 2018
isotope infinite load
View isotope infinite load.js
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;
View facetwp put zero price last.php
<?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;
View car-functions.php
<?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;
View infowindow open trigger
// 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);
}
You can’t perform that action at this time.