This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
add_filter('fluentform/rendering_field_data_input_checkbox', function ($data, $form) { | |
if ($form->id != 1) { // Form ID | |
return $data; | |
} | |
// Set which field to do this on | |
if (\FluentForm\Framework\Helpers\ArrayHelper::get($data, 'attributes.name') != 'products') { // Field name | |
return $data; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
add_filter('body_class', function ($classes) { | |
if (is_singular('fl-theme-layout')) { | |
$current_post_id = get_the_ID(); | |
$layout_type = get_post_meta($current_post_id, '_fl_theme_layout_type', true); | |
$location_settings = get_post_meta($current_post_id, '_fl_theme_builder_locations', true); | |
// Proceed only if the layout type is 'singular' | |
if ($layout_type === 'singular' && !empty($location_settings) && is_array($location_settings)) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/*Turn Testimonials Module into Generic Slider*/ | |
.fl-builder-pp-testimonials-settings h1, | |
.fl-builder-pp-testimonials-settings .fl-builder-settings-tabs a:nth-child(2), | |
.fl-builder-pp-testimonials-settings .fl-builder-settings-tabs a:nth-child(3), | |
.fl-builder-pp-testimonials-settings #fl-builder-settings-section-heading_fonts, | |
.fl-builder-pp-testimonials-settings #fl-builder-settings-section-subtitle_fonts{ | |
display: none; | |
} | |
.slider-module.fl-builder-pp-testimonials-settings h1{ | |
display: block; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
add_filter('acf/load_field/key=YOUR_FIELD_KEY_HERE', function ($field) { | |
if (get_post_type() == 'post') { | |
$field['default_value'] = 'YOUR_DEFAULT_VALUE_HERE'; | |
} | |
return $field; | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
add_filter( 'fl_theme_builder_current_page_layouts', function( $layouts ) { | |
// Custom order | |
$custom_order = ['header', 'singular', 'archive', '404', 'part' , 'footer']; | |
$sorted_layouts = []; | |
// Populate sorted_layouts based on custom_order | |
foreach ($custom_order as $type) { | |
if (isset($layouts[$type])) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* Improved Dragging BB Nodes */ | |
.fl-lightbox{ | |
transition: all .2s ease-in-out; | |
} | |
.fl-builder-dragging .fl-lightbox{ | |
opacity: .25; | |
} | |
.fl-builder-block-drag-helper.ui-sortable-helper { | |
margin-top: 40px; | |
margin-left: 20px; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function acf_relationship_shortcode($atts) { | |
$atts = shortcode_atts(array( | |
'name' => '', // ACF field name for the relationship | |
'display' => '', // ACF field name or WordPress field to display from the related post | |
'size' => 'full' // OPTIONAL - Size of the featured image (defaults to 'full') | |
), $atts); | |
if (empty($atts['name']) || empty($atts['display'])) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div class="hero-slider"> | |
<List saved_ids> | |
<Loop type=fl-builder-template taxonomy=fl-builder-template-category terms=home-hero-slider> | |
<Item><Field id /></Item> | |
</Loop> | |
</List> | |
<Loop list=saved_ids> | |
<div class="element"> | |
<Shortcode fl_builder_insert_layout id="{Field}" type=fl-builder-template /> | |
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php // ignore - for gist formatting | |
// Specify your ACF field here | |
add_filter('acf/load_field/name=your_field_name', function ($field) { | |
global $pagenow; | |
// Set the default term ID | |
$default_value = 'XXX'; | |
// Apply the default value only when creating a new post |
NewerOlder