Skip to content

Instantly share code, notes, and snippets.

View MaruscaGabriel's full-sized avatar

Marusca Gabriel MaruscaGabriel

View GitHub Profile
@MaruscaGabriel
MaruscaGabriel / wp-config.php
Created December 3, 2019 03:42 — forked from MikeNGarrett/wp-config.php
All those damned wp-config constants you can never remember.
<?php
// PHP memory limit for this site
define( 'WP_MEMORY_LIMIT', '128M' );
define( 'WP_MAX_MEMORY_LIMIT', '256M' ); // Increase admin-side memory limit.
// Database
define( 'WP_ALLOW_REPAIR', true ); // Allow WordPress to automatically repair your database.
define( 'DO_NOT_UPGRADE_GLOBAL_TABLES', true ); // Don't make database upgrades on global tables (like users)
// Explicitely setting url
@MaruscaGabriel
MaruscaGabriel / email-validation.js
Created February 22, 2018 12:44
Email Validation Using jQuery
jQuery(document).ready(function(e) {
jQuery('.submit-button-class').click(function() {
var valEmail = jQuery('.email-field-class').val();
if (jQuery.trim(valEmail).length == 0) {
alert('Please enter valid email address');
e.preventDefault();
}
if (validateEmail(valEmail)) {
}
else {
@MaruscaGabriel
MaruscaGabriel / fix-mobile-ment.md
Last active September 18, 2018 12:40 — forked from fazen/fix-mobile-ment.md
Add Clickable functioanlities to Divi Collapsing Nested Menu Items

Thank you Stefano Mortellaro for the code!

<style type="text/css">
#main-header .et_mobile_menu .menu-item-has-children > a { background-color: transparent; position: relative; }
#main-header .et_mobile_menu .menu-item-has-children > a:after { font-family: 'ETmodules'; text-align: center; speak: none; font-weight: normal; font-variant: normal; text-transform: none; -webkit-font-smoothing: antialiased; position: absolute; }
#main-header .et_mobile_menu .menu-item-has-children > a:after { font-size: 16px; content: '\4c'; top: 13px; right: 10px; }
#main-header .et_mobile_menu .menu-item-has-children.visible > a:after { content: '\4d'; }
#main-header .et_mobile_menu ul.sub-menu { display: none !important; visibility: hidden !important;  transition: all 1.5s ease-in-out;}
#main-header .et_mobile_menu .visible > ul.sub-menu { display: block !important; visibility: visible !important; }
</style>
@MaruscaGabriel
MaruscaGabriel / functions.php
Last active November 5, 2021 01:40
WordPress (DIVI) code snippets
<?php
// Limit the number of revisions to 3
add_filter( 'wp_revisions_to_keep', 'divi_limit_revisions', 10, 2 );
function divi_limit_revisions( $num ) {
$num = 3;
return $num;
}
//Disable Emoji
@MaruscaGabriel
MaruscaGabriel / code.js
Last active November 5, 2021 01:42
DIVI theme JavaScript code snippets
//Open external links into new tab
<script type="text/javascript">
jQuery('a').filter(function () {
return this.hostname != window.location.hostname;
}).attr('target', '_blank');
</script>
//Adding Fly-in Animations To Any Divi Section, Row and Module
//thanks to Gino Quiroz : https://quiroz.co/adding-fly-in-animations-to-any-divi-module/
//Below are the CSS Class groups for each animation.
@MaruscaGabriel
MaruscaGabriel / style.css
Last active April 5, 2017 17:00
DIVI theme CSS code snippets by https://marusca.design
/* hide top header on scroll by Geno Quiroz */
#top-header {
z-index: 9;}
#main-header{
transition: 0.5s;
-moz-transition: 0.5s;
-webkit-transition: 0.5s;}
#main-header.et-fixed-header {
top: 0 !important;}
@MaruscaGabriel
MaruscaGabriel / functions.php
Created July 2, 2015 13:29
Disable Emojis in WordPress
//Disable Emojis
function disable_wp_emojicons() {
// all actions related to emojis
remove_action( 'admin_print_styles', 'print_emoji_styles' );
remove_action( 'wp_head', 'print_emoji_detection_script', 7 );
remove_action( 'admin_print_scripts', 'print_emoji_detection_script' );
remove_action( 'wp_print_styles', 'print_emoji_styles' );
remove_filter( 'wp_mail', 'wp_staticize_emoji_for_email' );
remove_filter( 'the_content_feed', 'wp_staticize_emoji' );
@MaruscaGabriel
MaruscaGabriel / functions.php
Created March 10, 2015 20:00
Customize tag cloud widget
/* Customize tag cloud widget*/
function my_tag_text_callback( $count ) {
return sprintf( _n('%s Articles', '%s Articles', $count), number_format_i18n( $count ) );
}
add_filter('widget_tag_cloud_args','set_number_tags');
function set_number_tags($args) {
$args = array('smallest' => 11, 'largest' => 11, 'number' => 30, 'orderby' => 'count','order' => 'DESC', 'topic_count_text_callback' => 'my_tag_text_callback' );
return $args;
}
@MaruscaGabriel
MaruscaGabriel / functions.php
Created March 9, 2015 18:19
Remove Schema.org markup wraping Genesis
add_filter( 'genesis_attr_entry', 'prefix_attributes_entry_content', 15 );
function prefix_attributes_entry_content( $attributes ) {
unset( $attributes['class'] );
unset( $attributes['itemprop'] );
unset( $attributes['itemtype'] );
unset( $attributes['itemscope'] );
//* Blog posts microdata
if ( 'post' === get_post_type() ) {
$attributes['class'] = join( ' ', get_post_class() );
@MaruscaGabriel
MaruscaGabriel / home.php
Last active August 29, 2015 14:16
Remove pagination in Genesis pages
remove_action( 'genesis_after_endwhile', 'genesis_posts_nav' );