Skip to content

Instantly share code, notes, and snippets.

@wpsoul
wpsoul / gist:c8fc9b929e2a90a5863528d7b185a39b
Created November 13, 2023 19:38
Double Slide menu in Wordpress Gutenberg greenshift
<!-- wp:greenshift-blocks/iconbox {"id":"gsbp-de9cdb78-8092","inlineCssStyles":null,"interactionLayers":[{"triggerData":{"trigger":"click"},"actions":[{"actionname":"toggle-class","env":"no-action","classname":"active","selector":".menuslider"}],"env":"no-action"}],"containerLink":"#","iconBox_icon":{"icon":{"font":"rhicon rhi-bars","svg":"","image":""},"fill":"currentColor","fillhover":"","type":"font"},"linkTitle":"Menu trigger"} -->
<div class="wp-block-greenshift-blocks-iconbox gspb_iconBox gspb_iconBox-id-gsbp-de9cdb78-8092" id="gspb_iconBox-id-gsbp-de9cdb78-8092"><a class="gspb-containerlink" href="#" title="Menu trigger" rel="noopener"><div class="gspb_iconBox__wrapper" style="display:inline-flex" data-gspbactions="[{&quot;triggerData&quot;:{&quot;trigger&quot;:&quot;click&quot;},&quot;actions&quot;:[{&quot;actionname&quot;:&quot;toggle-class&quot;,&quot;env&quot;:&quot;no-action&quot;,&quot;classname&quot;:&quot;active&quot;,&quot;selector&quot;:&quot;.menuslider&quot;}],&quot;env&quot;:&quot;no-actio
@wpsoul
wpsoul / gist:8b07f63aaa770fae2bdbd301f1d29ee1
Created November 13, 2023 19:31
Dynamic Accordion for Greenshift wordpress and repeatable field
<!-- wp:greenshift-blocks/repeater {"id":"gsbp-7c7bd810-389b","inlineCssStyles":null,"border":{"borderRadius":{"values":{},"locked":true}},"columnGrid":[1,3,2,1],"dynamicField":"accordion","post_type":"post"} -->
<!-- wp:greenshift-blocks/container {"id":"gsbp-f334cf9e-4e11","inlineCssStyles":null,"border":{"borderRadius":{"values":{"topLeft":["6px"],"topRight":["6px"],"bottomRight":["6px"],"bottomLeft":["6px"]},"locked":true},"style":{"all":["solid"]},"size":{"all":[1]},"color":{"all":["var(\u002d\u002dwp\u002d\u002dpreset\u002d\u002dcolor\u002d\u002dlightgrey, #A8B8CD)"]},"styleHover":{},"sizeHover":{},"colorHover":{}},"className":"qawrap"} -->
<div class="wp-block-greenshift-blocks-container gspb_container gspb_container-gsbp-f334cf9e-4e11 qawrap" id="gspb_container-id-gsbp-f334cf9e-4e11"><!-- wp:greenshift-blocks/container {"id":"gsbp-3cc4d512-15df","inlineCssStyles":null,"dynamicGClasses":[{"value":"qaquestion","type":"local","label":"qaquestion","localed":false,"css":"","attributes":{},"originalID":"gsb
/**
* WordPress dependencies
*/
import {__} from '@wordpress/i18n';
import {RichText} from "@wordpress/block-editor";
import {Component, Fragment} from '@wordpress/element';
import {compose} from "@wordpress/compose";
import {withFocusOutside} from "@wordpress/components";
/**
@wpsoul
wpsoul / gist:81d5b7e0b0d26cc66ff822991559f8bb
Created November 26, 2021 11:31
Advanced Sliders for Gutencon plugin
<!-- wp:paragraph -->
<p>Slider/Carousel Block is very powerful and highly customizable block which can be used to slide or carousel anything. In this page we show some examples for sliders with 1 item per slide, you can place any other blocks or complex groups inside each slide.</p>
<!-- /wp:paragraph -->
<!-- wp:gutencon/numberheading {"circlestyle":true,"position":"1","title":"Slider for Offer boxes","subtitle":"It has also custom Slider effect","numberColor":"#cf2e2e","blockid":"nhead6312"} /-->
<!-- wp:gutencon/swiper {"blockId":"gut-096fc2d7-77b4-49f0-aa1a-9780402d7e90","tabs":3,"speed":500,"navposleftside":"-50px","navposrightside":"-50px","effect":"creative"} -->
<style>.gut-096fc2d7-77b4-49f0-aa1a-9780402d7e90 .swiper-slide-inner{background-color:#ffffff;padding:20px 20px;min-height:160px;display:flex;align-items:center;justify-content:center}.gut-096fc2d7-77b4-49f0-aa1a-9780402d7e90 .swiper-pagination{bottom:0px;text-align:center}.gut-096fc2d7-77b4-49f0-aa1a-9780402d7e90 .swiper-scrollbar{visibili
@wpsoul
wpsoul / gist:d9103e59568005aea0639aa2f7f2e452
Created November 9, 2020 16:52
Old category custom meta for options
//Category old fields here
add_action('admin_init', 'category_custom_fields', 1);
if( !function_exists('category_custom_fields') ) {
function category_custom_fields()
{
add_action('category_edit_form_fields', 'category_custom_fields_form');
add_action('edited_category', 'category_custom_fields_save');
add_action( 'create_category', 'category_custom_fields_save');
add_action( 'category_add_form_fields', 'category_custom_fields_form_new');
//////////////////////////////////////////////////////////////////
// Score box
//////////////////////////////////////////////////////////////////
if( !function_exists('wpsm_scorebox_shortcode') ) {
function wpsm_scorebox_shortcode( $atts, $content = null ) {
extract(shortcode_atts(array(
'criterias' => 'editor',
'simplestar' => '',
'offerbtn' => 'yes',
@wpsoul
wpsoul / functions.php
Last active August 2, 2020 00:44 — forked from gelebrin/functions.php
Add Articles to Store page(WCFM) - REHUB
add_action( 'wcfmmp_before_store_article', function( $store_id, $store_info ) {
?>
<div class="main-side clearfix<?php if (rehub_option('archive_layout') == 'gridfull' || rehub_option('archive_layout') == 'dealgridfull' || rehub_option('archive_layout') == 'compactgridfull' || rehub_option('archive_layout') == 'columngridfull' || rehub_option('archive_layout') == 'cardblogfull') : ?> full_width<?php endif ;?>">
<?php if (rehub_option('archive_layout') == 'blog') : ?>
<div class="">
<?php elseif (rehub_option('archive_layout') == 'newslist') : ?>
<div class="">
<?php elseif (rehub_option('archive_layout') == 'communitylist') : ?>
//////////////////////////////////////////////////////////////////
// Offer List
//////////////////////////////////////////////////////////////////
if( !function_exists('wpsm_afflist_shortcode') ) {
function wpsm_afflist_shortcode( $atts, $content = null ) {
if(!isset($atts['show'])) {
$atts['show'] = 10;
}
# ----------------------------------------------------------------------
# Expires headers (for better cache control)
# ----------------------------------------------------------------------
# These are pretty far-future expires headers.
# They assume you control versioning with filename-based cache busting
# Additionally, consider that outdated proxies may miscache
# http://www.stevesouders.com/blog/2008/08/23/revving-filenames-dont-use-querystring/
# If you don't use filenames to version, lower the CSS and JS to something like
# "access plus 1 week".