Skip to content

Instantly share code, notes, and snippets.

<?php
class ET_Builder_Module_Shop extends ET_Builder_Module_Type_PostBased {
function init() {
$this->name = esc_html__( 'Shop', 'et_builder' );
$this->slug = 'et_pb_shop';
$this->fb_support = true;
$this->whitelisted_fields = array(
'type',
'posts_number',
'columns_number',
@kary4
kary4 / gist:5407193739d2060439f1bd91591b6daf
Last active July 22, 2018 13:43
Include Projects In The Divi Search Module
remove_action( 'pre_get_posts', 'et_pb_custom_search', 11 );
function my_et_pb_custom_search( $query = false ) {
if ( is_admin() || ! is_a( $query, 'WP_Query' ) || ! $query->is_search ) {
return;
}
if ( isset( $_GET['et_pb_searchform_submit'] ) ) {
$postTypes = array();
if ( ! isset($_GET['et_pb_include_posts'] ) && ! isset( $_GET['et_pb_include_pages'] ) ) $postTypes = array( 'post' );
if ( isset( $_GET['et_pb_include_pages'] ) ) $postTypes = array( 'page' );
<script>
jQuery( document ).ready(function() {
jQuery('.mobile_nav,.select_page').click(function(e){
if(e.target != this) return;
jQuery('.mobile_menu_bar.mobile_menu_bar_toggle').trigger('click');
});
<script>
jQuery( document ).ready(function() {
jQuery('.post-meta').each(function(){
var thisMeta = jQuery(this).html();
thisMeta = thisMeta.replace(/Comments/,'Comentarios');
jQuery(this).html(thisMeta);
});
<script id="custom-blog-module">
jQuery( document ).ready(function() {
var checkInterval;
function blog_custom_meta () {
if ((parseInt(jQuery('.wpc-blog').css('opacity')) || jQuery('body').hasClass('archive') || jQuery('body').hasClass('single-post')) > 0.9) {
clearInterval(checkInterval);
jQuery('.post-meta').each(function(){
var thisTime = jQuery(this).find('.published').html();
<script>
jQuery( document ).ready(function() {
jQuery('.et_pb_slider .et_pb_more_button').attr('target','new');
});
</script>
@kary4
kary4 / gist:605e894e9096a682dc223e01fe6b4aee
Last active July 9, 2018 21:59
Fixed Header Effect Animation
<script>
jQuery( document ).ready(function() {
jQuery(window).scroll(function(){
if (jQuery(this).scrollTop() > 5) {
jQuery('#main-header').addClass('et-fixed-header');
} else {
jQuery('#main-header').removeClass('et-fixed-header');
}
body {background-image: url('YOUR-IMAGE');
background-attachment: fixed;
}
<script>
jQuery( document ).ready(function() {
jQuery('li.et_social_facebook a').removeClass('et_social_share').attr('href','#FACEBOOK_URL');
jQuery('li.et_social_linkedin a').removeClass('et_social_share').attr('href','#LINKEDIN_URL');
});
</script>
<script>
jQuery( document ).ready(function() {
jQuery('.post-meta').each(function(){
var thisTime = jQuery(this).find('.published').html();
var thisCat = jQuery(this).find('a[rel="category tag"]').html();
thisCat = thisCat.replace(/,/g,'');
var thisAuthor = jQuery(this).find('.author.vcard').html();