Skip to content

Instantly share code, notes, and snippets.

@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');
@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
/**
* 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";
/**
# ----------------------------------------------------------------------
# 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".
@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
@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:4482294633d84639e5f460ad4d084a98
Created November 17, 2023 20:28
Breath effect in Greenshift WordPress
<!-- wp:greenshift-blocks/container {"id":"gsbp-7fa1e64f-d452","inlineCssStyles":"#gspb_container-id-gsbp-7fa1e64f-d452.gspb_container{flex-direction: column;box-sizing: border-box;}#gspb_container-id-gsbp-7fa1e64f-d452.gspb_container \u003e p:last-of-type{margin-bottom:0}.gspb_container{position:relative;}#gspb_container-id-gsbp-7fa1e64f-d452.gspb_container{display:flex;flex-direction:row;justify-content:center;align-items:center;column-gap:20px;}#gspb_container-id-gsbp-7fa1e64f-d452.gspb_container \u003e *:not(.block-editor-inner-blocks){margin-right:25px;margin-bottom:15px;margin-left:25px;}#gspb_container-id-gsbp-7fa1e64f-d452.gspb_container{margin-top:10px;margin-bottom:100px;}","flexbox":{"type":"flexbox","flexDirection":["row"],"justifyContent":["center"],"alignItems":["center"],"marginBottom":[15],"marginLeft":[25],"marginRight":[25],"columngap":["20px"]},"spacing":{"margin":{"values":{"top":["10px"],"bottom":["100px"]},"unit":["px","px","px","px"],"locked":false},"padding":{"values":{},"unit":["px","
<!-- wp:greenshift-blocks/container {"id":"gsbp-3606c12f-ac49","inlineCssStyles":null,"flexbox":{"type":"grid","gridcolumns":[3,2,2,1],"columngap":[30],"rowgap":[30]}} -->
<div class="wp-block-greenshift-blocks-container gspb_container gspb_container-gsbp-3606c12f-ac49" id="gspb_container-id-gsbp-3606c12f-ac49"><!-- wp:greenshift-blocks/container {"id":"gsbp-90c60fdf-9873","inlineCssStyles":null,"rowspan":[],"columnspan":[],"flexbox":{},"animation":{"duration":700,"easing":"ease"},"background":{"color":"#f7f8fa"},"overlay":{"color":"#7000f4","circleclip":"left center","hoverEditor":"yes","circleclipsize":300,"image":[null],"size":["cover"],"repeat":["no-repeat"],"overlayState":"Gradient","gradient":"linear-gradient(to top right,var(\u002d\u002dwp\u002d\u002dpreset\u002d\u002dcolor\u002d\u002dsecondary) 0%,var(\u002d\u002dwp\u002d\u002dpreset\u002d\u002dcolor\u002d\u002dprimary) 100%)","hoverShiftX":"","hoverOverflow":"yes","hoverShiftY":"","hoverRotate":"","hoverScale":""},"border":{"borderRadius":{"values":{
@wpsoul
wpsoul / gist:c005cc71046f7a80e8a4b1f86418a799
Created November 22, 2023 03:22
Color change on scroll with different custom reverse colors (Greenshift WordPress)
<!-- wp:greenshift-blocks/row {"id":"gsbp-9a008358-cd5c","inlineCssStyles":"#gspb_row-id-gsbp-9a008358-cd5c{justify-content: space-between;margin-top: 0px;margin-bottom: 0px;display: flex;flex-wrap: wrap;}#gspb_row-id-gsbp-9a008358-cd5c \u003e .gspb_row__content {display: flex;justify-content: space-between;margin: 0 auto;width: 100%;flex-wrap: wrap;}.gspb_row{position:relative;}div[id^=gspb_col-id]{padding:15px min(3vw, 20px);box-sizing:border-box;position:relative;}body.gspb-bodyfront #gspb_row-id-gsbp-9a008358-cd5c \u003e .gspb_row__content{max-width:var(\u002d\u002dwp\u002d\u002dstyle\u002d\u002dglobal\u002d\u002dwide-size, 1200px);}#gspb_row-id-gsbp-9a008358-cd5c{margin-top:200px;padding-top:250px;padding-bottom:250px;}body .bgchange{background-color:#000000;}body .bgchange{color:#ffffff;}body .bgchange{transition:all 1s cubic-bezier(0.165,0.84,0.44,1);}body .bgchange.active .colortext{color:#0e6cb1;}","dynamicGClasses":[{"value":"bgchange","type":"local","label":"bgchange","localed":false,"css":"body .b
@wpsoul
wpsoul / gist:9592093bb56e98396a015a1e1846f282
Created November 25, 2023 00:33
Sticked panel section in Greenshift Wordpress
<!-- wp:greenshift-blocks/container {"id":"gsbp-6ef084ec-4689","inlineCssStyles":"#gspb_container-id-gsbp-6ef084ec-4689.gspb_container{flex-direction: column;box-sizing: border-box;}#gspb_container-id-gsbp-6ef084ec-4689.gspb_container \u003e p:last-of-type{margin-bottom:0}.gspb_container{position:relative;}#gspb_container-id-gsbp-6ef084ec-4689.gspb_container{display:flex;flex-direction:column;row-gap:200px;}body.gspb-bodyfront #gspb_container-id-gsbp-6ef084ec-4689.gspb_container{position:relative;}body.gspb-bodyfront #gspb_container-id-gsbp-6ef084ec-4689.gspb_container{min-height:2400px;}@media (max-width: 575.98px){body.gspb-bodyfront #gspb_container-id-gsbp-6ef084ec-4689.gspb_container{min-height:3400px;}}","flexbox":{"type":"flexbox","flexDirection":["column"],"rowgap":["200px"]},"position":{"positionType":["relative","","",""],"positions":{"values":{}}},"blockWidth":{"customWidth":{"value":[]},"customHeight":{"value":[]},"heightType":"custom","minHeight":["2400px",null,null,"3400px"]}} -->
<div class="wp-