Skip to content

Instantly share code, notes, and snippets.

View mdjwel's full-sized avatar
🎯
Focusing

Eh Jewel mdjwel

🎯
Focusing
View GitHub Profile
@mdjwel
mdjwel / popular_posts_query.php
Last active September 11, 2021 06:40
WordPress Custom Query Based Condition
@DavidPeralvarez
DavidPeralvarez / core-blocks.txt
Last active September 20, 2022 08:04
Gutenberg core blocks list
// Útil para filtros de Gutenberg como "allowed_block_types"
archives
audio
button
categories
code
column
columns
coverImage
@mdjwel
mdjwel / social_networks_share_urls.php
Last active July 25, 2018 18:01
A collection of social site's share URL
<?php
function chaoz_social_share() { ?>
<a href="https://facebook.com/sharer/sharer.php?u=<?php the_permalink(); ?>"><i class="social_facebook"></i></a>
<a href="https://twitter.com/intent/tweet?text=<?php the_permalink(); ?>"><i class="social_twitter"></i></a>
<a href="https://www.pinterest.com/pin/create/button/?url=<?php the_permalink() ?>"><i class="social_pinterest"></i></a>
<a href="https://plus.google.com/share?url=<?php the_permalink() ?>"><i class="social_google_plus"></i></a>
<a href="https://www.linkedin.com/shareArticle?mini=true&url=<?php the_permalink() ?>"><i class="social_linkedin"></i></a>
<?php
}
@wpbean
wpbean / functions.php
Created May 27, 2018 10:18
Elementor adding new control
<?php
add_action('elementor/element/before_section_end', function( $section, $section_id, $args ) {
if( $section->get_name() == 'section' && $section_id == 'section_layout' ){
$section->add_control(
'wpb_section_padding',
[
'label' => _x( 'Section Padding (top & bottom)', 'Section Control', 'wpb-plugins' ),
'type' => Elementor\Controls_Manager::SELECT,
@zecka
zecka / vc_custom_icon_set.php
Last active October 7, 2020 08:17
Add a custom icon set from icomoon to visual composer vc_icon shortcode
<?php
// Add new custom font to Font Family selection in icon box module
function zeckart_add_new_icon_set_to_iconbox( ) {
$param = WPBMap::getParam( 'vc_icon', 'type' );
$param['value'][__( 'IcoMoon', 'total' )] = 'icomoon';
vc_update_shortcode_param( 'vc_icon', $param );
}
add_filter( 'init', 'zeckart_add_new_icon_set_to_iconbox', 40 );
@mdjwel
mdjwel / vc_custom_icon_font.php
Last active May 5, 2018 07:30
Visual composer custom icon font integration. Here I integrated the thimify icon package.
<?php
add_action( 'vc_before_init', function() {
if (class_exists('WPBMap')) {
add_filter('init', function () {
$param = WPBMap::getParam('vc_icon', 'type');
$param['value'][__('Thimify Icon', 'total')] = 'themify_icon';
vc_update_shortcode_param('vc_icon', $param);
}, 40);