Skip to content

Instantly share code, notes, and snippets.


mark l chaves marklchaves

View GitHub Profile
marklchaves /
Last active Sep 24, 2021
How to Create a Floating Column Using CSS position: sticky in Avada


  1. Create your columns in Fustion Builder.
  2. Select the column you want to be sticky.
  3. Add floating-toc to the CSS Class setting for the column you selected.
  4. Add the following CSS to the page's CSS editor.
/** Add this to your page's CSS */
.floating-toc {
marklchaves / disable-popup-maker-if-using-divi-builder.php
Last active Sep 23, 2021
Disable Popup Maker if Using Divi Builder
View disable-popup-maker-if-using-divi-builder.php
<?php // Ignore this first line when copying to your child theme's functions.php file.
function pm_disable_on_divi_editor( $is_loadable ) {
// If Divi builder is running, don't load Popup Maker.
if ( et_core_is_fb_enabled() ) {
$is_loadable = false;
return $is_loadable;
// It's OK to load Popup Maker if we get here.");
marklchaves /
Last active Sep 20, 2021
List of supported content types for the Content Control WordPress plugin

Content Control Plugin

List of supported content types

  • Posts
    • A Post
    • A Selected Post
    • A Post with ID
    • A Post with Category
    • A Post with Tag
marklchaves / avada-change-portfolio-archive-pagination-labels.js
Last active Sep 16, 2021
Avada - Override Previous and Next for Portfolio Single and Archive
View avada-change-portfolio-archive-pagination-labels.js
* This JavaScript will override the Previous and Next pagination labels for the Avada Portfolio
* archive page.
* Target HTML
* <a class="pagination-prev" rel="prev" href="http://avada.local/portfolio-items/"><span class="page-prev"></span><span class="page-text">COOL</span></a>
* <a class="pagination-next" rel="next" href="http://avada.local/portfolio-items/page/2/"><span class="page-text">RIGHT ON</span><span class="page-next"></span></a>
marklchaves / custom_pagination_blog_post_links_for_avada.php
Last active Sep 16, 2021
Custom Pagination Links for Avada Blog Posts - Display Blog Post Titles Instead of the Boring Previous and Next
View custom_pagination_blog_post_links_for_avada.php
* Custom Pagination Links for Avada Blog Posts
* Instead of displaying Previous and Next, display the blog post
* titles.
* Replace the pagination code in your child theme’s single.php with this.
$previous = get_previous_post();
View avada-equal-height-testimonials-functions.php
<?php // Ignore this first line when copying to your child theme's functions.php file.
function my_custom_equal_height_testimonials_script()
{ ?>
<script type="text/javascript">
jQuery(document).ready(function($) {
function makeEqualHeights() {
let maxHeight = Math.max(...
$(".review").map(function() {
return $(this).height();
marklchaves / sticky-buttons-functions.php
Last active Sep 9, 2021
Adding sticky buttons fixed to the bottom of a page in Avada
View sticky-buttons-functions.php
// Add this code to your child theme's functions.php file.
* Sticky Buttons Fixed to the Bottom of the Page
function add_sticky_buttons() {
echo '
<div class="sticky-btn-wrapper">
<a href="#showcase" class="btn sticky-btn sticky-btn__left">Sticky 1</a>
<a href="#section-b" class="btn sticky-btn sticky-btn__right">Sticky 2</a>
marklchaves / schedule-a-popup.php
Last active Sep 8, 2021 — forked from waltermesser/schedule-a-popup.php
Popup Maker Plugin: A basic example of scheduling a popup to display during a certain timeframe.
View schedule-a-popup.php
<?php // Ignore this first line when copying to your child theme's functions.php file.
function schedule_my_popup( $is_loadable, $popup_id ) {
if( $popup_id == 14 ) { // Change to your popup ID.
date_default_timezone_set('Asia/Singapore'); // Change to your time zone.
$now = strtotime( 'now' );
$start = strtotime( 'September 8, 2021 12:00PM' ); // Change to your local start time.
marklchaves / woocommerce-exclude-product-category-from-shop-page.php
Last active Sep 6, 2021
WooCommerce: Exclude the Test product category from shop page except for admins and testers.
View woocommerce-exclude-product-category-from-shop-page.php
* Exclude test products from a particular category on the shop page
* for non admins and non testers.
* I.e., only let admins and testers see test products.
* Reference: