Skip to content

Instantly share code, notes, and snippets.

View fahimxyz's full-sized avatar
🌼
I may be slow to respond.

Fahim fahimxyz

🌼
I may be slow to respond.
View GitHub Profile
@fahimxyz
fahimxyz / gutenberg.txt
Created March 8, 2021 12:25 — forked from chrismccoy/gutenberg.txt
Gutenberg Resources
Getting Started with Block Themes: Patterns
https://themeshaper.com/2021/01/11/getting-started-with-block-themes-patterns/
WordPress Blocks Backwards Compatibility
https://webdevstudios.com/2020/12/29/wordpress-blocks-backwards-compatibility/
Stylin’ WordPress Gutenberg Columns Block
https://dbushell.com/2020/11/02/wordpress-gutenberg-columns-block-css-styles/
Gutenberg Components and Invalid Hook Call Error in React
<?php
$product_content = apply_filters('the_content', get_post_field('post_content', $postID));
$product_content = preg_replace( '/et_pb_([a-z]+)_(\d+)_tb_body/', 'et_pb_df_ajax_filter_${1}_${2}_tb_body', $product_content );
$product_content = preg_replace( '/et_pb_([a-z]+)_(\d+)( |")/', 'et_pb_df_ajax_filter_${1}_${2}${3}', $product_content );
echo $product_content;
// retrieve the styles for the modules
$internal_style = ET_Builder_Element::get_style();
<?php
// Make sure you replace the following in the example:
// - META_KEY_HERE
// - LABEL_HERE
// - VISUAL_GROUP_LABEL_HERE
// Register your new Dynamic Content fields:
add_filter( 'et_builder_custom_dynamic_content_fields', function ( $custom_fields, $post_id, $raw_custom_fields ) {
$custom_fields['custom_meta_META_KEY_HERE'] = array(
'label' => esc_html( 'LABEL_HERE' ),

Note: This tutorial series is intended for advanced users. At least a basic understanding of coding in PHP and JavaScript is required.

Divi module setting fields support the use of Dynamic Content, allowing you to build dynamic modules that display information pulled from the site's database.

Enable Dynamic Content

@fahimxyz
fahimxyz / wp-config.php
Created July 31, 2020 07:55
wordpress error defines
<?php
define( 'WP_DEBUG', true );
define( 'WP_DEBUG_LOG', true );
define( 'WP_DEBUG_DISPLAY', true );
//define( 'PREFIX_DEBUG', false );
xcode-select --install
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
brew update
brew cask install iterm2
# update iterm2 settings -> colors, keep directory open new shell, keyboard shortcuts
brew install bash # latest version of bash
# set brew bash as default shell
brew install fortune
brew install cowsay
brew install git
@fahimxyz
fahimxyz / gist:e355118d8e766a5a19c0bef5d7eefa4d
Created December 29, 2019 22:57
Get Facebook Page Access Token
https://fahimxyz.github.io/fb-page-token/
@fahimxyz
fahimxyz / DiviModuleName.jsx
Last active December 17, 2019 18:09
Divi Module JSX
// External Dependencies
import React, { Component } from 'react';
import Swiper from 'swiper';
// Internal Dependencies
import './style.css';
class Prefix_Module_Name extends Component {
static slug = 'prefix_module_name';
@fahimxyz
fahimxyz / DiviModuleName.php
Created November 6, 2019 09:31
Divi Module Class
<?php
class Prefix_Module_Name extends ET_Builder_Module {
public $slug = 'module_slug_name';
public $vb_support = 'on';
protected $module_credits = array(
'module_uri' => 'module_url',
'author' => 'Author Name',
<?php
/*
* WordPress Breadcrumbs
* author: Dimox
* version: 2019.03.03
* license: MIT
*/
function dimox_breadcrumbs() {
/* === OPTIONS === */