Skip to content

Instantly share code, notes, and snippets.

View Review heading block
/**
* 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 Nov 26, 2021
Advanced Sliders for Gutencon plugin
View gist:81d5b7e0b0d26cc66ff822991559f8bb
<!-- 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 Nov 9, 2020
Old category custom meta for options
View gist:d9103e59568005aea0639aa2f7f2e452
//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');
View Custom scorebox with image
//////////////////////////////////////////////////////////////////
// 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 Aug 2, 2020 — forked from gelebrin/functions.php
Add Articles to Store page(WCFM) - REHUB
View functions.php
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') : ?>
View Offer list
//////////////////////////////////////////////////////////////////
// Offer List
//////////////////////////////////////////////////////////////////
if( !function_exists('wpsm_afflist_shortcode') ) {
function wpsm_afflist_shortcode( $atts, $content = null ) {
if(!isset($atts['show'])) {
$atts['show'] = 10;
}
View Link fontawesome preload example
View Best htaccess for Leverage Browser Caching
# ----------------------------------------------------------------------
# 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".
View Cashback Profile page
[wpsm_is_user][RH_ELEMENTOR id="1016"][/wpsm_is_user]
[wpsm_is_guest]You must be <a class="act-rehub-login-popup" href="#">loggined</a> on Site to See Cashback Profile.[/wpsm_is_guest]
View Custom Point Output in Buddypress profile
[mycred_show_if balance=1 ctype="cbtrkr_approved_usd"]
<div class="floatright ml15">
[wpsm_button_popup btn_text="Request cashback"] [contact-form-7 id="909" title="Request Payment"] [/wpsm_button_popup]
</div>
[/mycred_show_if]
<h3>Current approved Cashback is [mycred_total_balance types="cbtrkr_approved_usd"]</h3>
<div class="clearfix"></div>
[RH_ELEMENTOR id="871"]
<br />
<h3>Cashback History</h3>