Skip to content

Instantly share code, notes, and snippets.

<script type="text/javascript">
function equalize_heights() {
var maxHeight = 0, toequalize = jQuery(".equalize").parent();
toequalize.each(function() {
maxHeight = 0;
toequalize.find('.equalize').each(function(){
jQuery(this).height('auto');
if (jQuery(this).height() > maxHeight) { maxHeight = jQuery(this).height(); }
});
toequalize.find(".equalize").height(maxHeight);
jQuery(document).ready(function() {
var maxHeight = 0;
jQuery(".equalize").each(function(){
if (jQuery(this).height() > maxHeight) { maxHeight = jQuery(this).height(); }
});
jQuery(".equalize").height(maxHeight);
});
var ET_PageBuilder = ET_PageBuilder || {};
window.wp = window.wp || {};
/**
* The builder version and product name will be updated by grunt release task. Do not edit!
*/
window.et_builder_version = '3.0.97';
window.et_builder_product_name = 'Divi';
<script>
jQuery(document).ready(function() {
jQuery.extend(true, jQuery.magnificPopup.defaults, {
tClose: 'Close (Esc)', // Alt text on close button
tLoading: 'Loading...', // Text that is displayed during loading. Can contain %curr% and %total% keys
gallery: {
tPrev: 'Previous (Left arrow key)', // Alt text on left arrow
tNext: 'Next (Right arrow key)', // Alt text on right arrow
tCounter: '%curr% de %total%' // Markup for "1 of 7" counter
},
<script type="text/javascript">
const ClickSound = new Audio("/uploads/b2.m4a");
var x = document.getElementsByClassName("click-button");
var i;
for (i = 0; i < x.length; i++) {
x[i].addEventListener("click", e => ClickSound.play());
}
</script>
function featuredtoRSS($content) {
global $post;
if ( has_post_thumbnail( $post->ID ) ){
$content = '<div>' . get_the_post_thumbnail( $post->ID, 'medium', array( 'style' => 'margin-bottom: 15px;' ) ) . '</div>' . $content;
}
return $content;
}
add_filter('the_excerpt_rss', 'featuredtoRSS');
add_filter('the_content_feed', 'featuredtoRSS');
$the_portfolio.on('click', '.et_pb_portfolio_filter a', function(e){
e.preventDefault();
var category_slug = $(this).data('category-slug');
var $the_portfolio = $(this).parents('.et_pb_filterable_portfolio');
var $the_portfolio_items = $the_portfolio.find('.et_pb_portfolio_items');
if ( 'all' == category_slug ) {
$the_portfolio.find('.et_pb_portfolio_filter a').removeClass('active');
$the_portfolio.find('.et_pb_portfolio_filter_all a').addClass('active');
<script>
(function($) {
$(document).ready(function() {
leftarea = $('#left-area');
pageNavi = leftarea.find('.wp-pagenavi');
pageNavigation = leftarea.find('.pagination');
if ( pageNavi.length ) {
pagenav = $('#left-area .wp-pagenavi');
}
add_action( 'pre_get_posts', 'et_custom_posts_per_page' );
function et_custom_posts_per_page( $query = false ) {
global $shortname;
if ( is_admin() ) {
return;
}
if ( ! is_a( $query, 'WP_Query' ) || ! $query->is_main_query() ) {
@import url('https://fonts.googleapis.com/css?family=Caveat');