Skip to content

Instantly share code, notes, and snippets.

View AchalJ's full-sized avatar

Achal Jain AchalJ

View GitHub Profile
@AchalJ
AchalJ / layou.html
Created February 20, 2024 18:01
PowerPack Content Grid - Replicate Style 8 with custom layout (Beaver Themer)
<div class="pp-content-grid-post-body">
[wpbb-if post:featured_image]
<div class="pp-content-grid-post-image">
[wpbb post:featured_image size="large" display="tag" linked="yes"]
</div>
[/wpbb-if]
<div class="pp-content-grid-post-text">
<h3 class="pp-content-grid-post-title">[wpbb post:link text="title"]</h3>
@AchalJ
AchalJ / code.php
Last active August 7, 2023 07:29
PowerPack Content Grid - Group post terms by taxonomies in meta
<?php // ignore this.
// Instructions:
// 1. Add the following CSS class to the Content Grid module: cg-with-meta-tags
// 2. Add the below code to your current theme's functions.php file.
add_action( 'pp_cg_before_post_content', function( $post_id, $settings ) {
if ( false === strpos( $settings->class, 'cg-with-meta-tags' ) ) {
return;
}
@AchalJ
AchalJ / code.js
Created June 8, 2023 11:03
PowerPack Google Map - Show Info Window on Hover Over Marker
// 1. Add the following CSS class to the PowerPack's Google Map module under the Advanced settings > HTML Element > Class: show-info-on-hover
// 2. Add this JavaScript code to Beaver Builder's Global JavaScript editor or in a JS file in your current child theme.
;(function($) {
var showInfoOnHover = function() {
var mapModules = $('.show-info-on-hover');
if ( mapModules.length === 0 ) {
return;
}
mapModules.each(function() {
@AchalJ
AchalJ / layout.css
Last active May 23, 2023 10:59
Content Grid - Custom Layout - 1 (Beaver Themer)
.pp-content-grid-post {
font-size: 14px;
background-color: #fff !important;
}
.pp-content-grid-post-image {
padding: 0;
position: relative;
}
.pp-content-grid-post-image a img {
filter: saturate(1.6) contrast(1.1);
@AchalJ
AchalJ / layout.css
Created March 29, 2023 07:42
PowerPack Content Grid - Replicate Style 9 with Custom Layout (Beaver Themer)
.pp-content-grid-post-tile {
position: relative;
height: 275px;
}
.pp-content-grid-post-image {
background-repeat: no-repeat;
background-position: center center;
background-size: cover;
height: 100%;
position: relative;
@AchalJ
AchalJ / layout.css
Created March 14, 2023 07:48
PowerPack Content Grid - Replicate Style 5 with Custom Layout (Beaver Themer)
.pp-content-grid-post {
font-size: 14px;
}
.pp-content-grid-post-image {
padding: 0px;
padding-bottom: 0;
height: 260px;
background-position: center;
background-repeat: no-repeat;
background-size: cover;
@AchalJ
AchalJ / code.php
Last active December 21, 2022 08:26
Posts matching filters fix for Beaver Builder Posts Grid + Content Grid
<?php // <- Ignore this
// Copy the code below and paste it to your child theme's functions.php file
add_filter( 'fl_builder_loop_query_args', function( $args ) {
$settings = $args['settings'];
$post_type = $args['post_type'];
$post__in = $post__not_in = array();
@AchalJ
AchalJ / css.css
Created November 3, 2022 17:20
Content Grid - CSS Grid to override isotope props
@media only screen and (min-width: 768px) {
.team-members-grid .pp-content-post-grid.pp-equal-height {
display: grid;
grid-template-columns: repeat(5, 1fr);
grid-auto-rows: min-content;
grid-column-gap: 3%;
grid-row-gap: 3ch;
height: auto !important;
}
.team-members-grid .pp-content-post-grid.pp-equal-height:before,
@AchalJ
AchalJ / code.php
Last active October 8, 2022 01:28
PP Taxonomy Term - Custom Shortcode to get term image URL
<?php // ignore this
// Copy the code below to your current theme's functions.php file.
// Uses: [get_term_image_url] or [get_term_image_url term_id="PROVIDE TERM ID HERE"]
add_shortcode( 'get_term_image_url', function( $atts ) {
$term_id = 0;
if ( isset( $atts['term_id'] ) && ! empty( $atts['term_id'] ) ) {
$term_id = $atts['term_id'];
} else {
@AchalJ
AchalJ / code.php
Created May 6, 2022 10:39
PowerPack Content Grid - Show only rendered products terms in filters
// PowerPack Content Grid - Show only rendered products terms in filters
add_action( 'pp_cg_before_posts', function( $settings, $query ) {
if ( 'no' == $settings->post_grid_filters_display || 'none' == $settings->post_grid_filters ) {
return;
}
add_filter( 'pp_cg_filtered_terms', function( $filtered_terms, $terms, $module_settings ) use ( $query ) {
$rendered_terms = array();
$posts = $query->get_posts();