Skip to content

Instantly share code, notes, and snippets.

View softiconic's full-sized avatar

Softiconic softiconic

View GitHub Profile
@softiconic
softiconic / function.php
Last active December 2, 2023 18:48
Disable updates for a specific plugin.
function filter_plugin_updates( $value ) {
unset( $value->response['elementor-pro/elementor-pro.php'] );
return $value;
}
add_filter( 'site_transient_update_plugins', 'filter_plugin_updates' );
tags: [<?php
foreach ( get_the_terms( get_the_ID(), 'listing-tag' ) as $tax ) {
echo '"' . __( $tax->slug ) . '",';
}
foreach ( get_the_terms( get_the_ID(), 'listing-amenity' ) as $tax ) {
echo '"' . __( $tax->slug ) . '",';
}
foreach ( get_the_terms( get_the_ID(), 'listing-category' ) as $tax ) {
echo '"' . __( $tax->slug ) . '",';
}
@softiconic
softiconic / read.html
Last active December 2, 2023 18:49
Implement a "Read More" functionality for content using JavaScript.
<div class="sccontent">
<p>default text here</p>
<p class="moretext">
more text here
</p>
</div>
<a class="readmore" href="#">Read more</a>
<style>
.moretext {
@softiconic
softiconic / gist:19b3790e39bfcf8bb19ee91bf7d08bb7
Last active December 2, 2023 18:49
Modify the image path for marker clustering on Google Maps.
//Cluster init
if (s.cluster) {
markerCluster = new MarkerClusterer(map, markers, {
maxZoom: 12,
gridSize: 40,
//add image path url
imagePath: "https://www.bitcoinatmnearme.com/wp-content/themes/findall/images/m",
});
}
@softiconic
softiconic / gist:db77e81b63580bf51a6b7096ec36507b
Last active December 2, 2023 18:50
Display posts using the shortcode [news id='1,2,3'].
<?php
// news
add_shortcode( 'news', 'news_shortcode' );
function news_shortcode( $atts ) {
extract(shortcode_atts(array(
'id' => null
), $atts, 'news'));
$post_ids = explode(",", strval($id));
ob_start();
@softiconic
softiconic / gist:7c4077231d95b4d7ed1c4761bf28b504
Last active December 2, 2023 18:50
Add a class on click.
$('#classorid').click(function() {
$('.classoridnew').addClass("class");
});
.ss .fa {
-webkit-transform: rotate(0);
-moz-transform: rotate(0);
-ms-transform: rotate(0);
-o-transform: rotate(0);
transform: rotate(0);
@softiconic
softiconic / gist:8a0308b626c86d19fab0c911308c26c4
Last active December 2, 2023 18:51
In Contact Form 7, set the first option as the label for a SELECT field.
[select* scteto first_as_label "select one" "item1" "item2" "item3" "item4" "item5"]
+ Design custom arrow
select {
-moz-appearance: none;
-webkit-appearance: none;
appearance: none;
background-image: url(../images/select-drop.svg);
background-repeat: no-repeat;
background-position: right center;
@softiconic
softiconic / gist:8b88e1b8e8f4db6fe9f4eebc3744c1d0
Last active December 2, 2023 18:51
Ensure HTML5 video compatibility across all devices.
<video class="scvideos3" autoplay loop muted playsInline width='100%' height='100%' preload="auto">
<source src="dd.webm" type="video/webm">
<source src="dd.mp4" type="video/mp4">
</video>
//another example
<video class="scvideo" preload="auto" loop="loop" muted="true" playsinline="true" autoplay="autoplay">
<source src="mpr.mp4" type="video/mp4">
</video>
@softiconic
softiconic / custom.js
Last active December 2, 2023 18:51
Remove a specific div from the contact form after submission.
jQuery( document ).ready(function( $ ){
$( document ).on('submit_success', '.contactsc2 .elementor-form', function(){
$submitted_form = $( this );
$('.contactsc2 .elementor-form-fields-wrapper').hide();
// $submitted_form.hide();
$('.contactsc2 .elementor-message-success').show();
});
});