Skip to content

Instantly share code, notes, and snippets.

View ImmortalN's full-sized avatar

ImmortalN ImmortalN

View GitHub Profile
@ImmortalN
ImmortalN / child_terms.php
Created July 21, 2025 14:19
JetEngine Dynamic Terms show child terms only
<?php
// add class 'dt-children-only' to widget
add_filter( 'jet-engine/listings/dynamic-terms/items', function( $terms, $post_id, $settings ) {
if ( ! is_array( $terms ) || false === strpos( $settings['_css_classes'] ?? $settings['className'] ?? '', 'dt-children-only' ) ) {
return $terms;
}
@ImmortalN
ImmortalN / pb_subchild.php
Created May 12, 2025 07:48
JetEngine Modify Profile Builder rewrite rules
<?php
// Debug query vars
add_action( 'wp', function() {
$query_vars = [
'pagename' => get_query_var( 'pagename' ),
'jet_pb' => get_query_var( 'jet_pb' ),
'jet_pb_subpage' => get_query_var( 'jet_pb_subpage' ),
];
error_log( '[JetEngine Profile Builder] Query Vars: ' . print_r( $query_vars, true ) );
} );
@ImmortalN
ImmortalN / dynamic_field_instead_clickable_listing.css
Created May 9, 2025 10:36
Dynamic Field instead of "Clickable Listing" option
.jet-listing-grid__item {
position: relative;
}
.test-link {
position: absolute;
top: 0;
left: 0;
right: 0;
bottom: 0;
@ImmortalN
ImmortalN / dynamic_link_instead_clickable_listing.css
Created May 9, 2025 10:36
Dynamic Link instead of "Clickable Listing" option
@ImmortalN
ImmortalN / term_instock_count_macros.php
Last active June 19, 2025 18:29
In-Stock Product Count for terms listing (Macros)
<?php
add_action( 'jet-engine/register-macros', function() {
if ( ! class_exists( 'Jet_Engine_Base_Macros' ) ) {
return;
}
class Term_Instock_Count_Macros extends Jet_Engine_Base_Macros {
public function macros_tag() {
@ImmortalN
ImmortalN / floating_label.html
Created April 28, 2025 21:36
JetFormBuilder Floating Label for Text Field
<style>
.jet-form-builder-row {
position: relative;
margin-bottom: 20px;
}
.field-type-text-field .jet-form-builder__label {
position: absolute;
left: 10px;
top: 50%;
@ImmortalN
ImmortalN / limit_for posts.php
Created April 22, 2025 11:23
Limit of posts for current user
<?php
add_shortcode( 'user_posts_limit', function( $atts ) {
// Parse shortcode attributes
$atts = shortcode_atts( array(
'post_type' => 'all',
), $atts );
// Check if JetEngine and Profile Builder module are active
if ( ! class_exists( '\Jet_Engine\Modules\Profile_Builder\Module' ) ) {