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
jQuery(document).ready(function($) { | |
// Add shadow class to containers and remove when you scroll to the bottom | |
const $recurringEventsLists = $('.recurring-events-list'); | |
function checkScrollAndHeight() { | |
const $this = $(this); | |
// Check if the content height is greater than the max-height of the container | |
if ($this.prop('scrollHeight') > $this.height()) { |
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="team-member wrapcenter"> | |
<div class="headshot-wrapper"> | |
<img class="team-headshot" src="[wpbb post:featured_image size='medium' display='url']"> | |
<!-- Button trigger modal --> | |
<button type="button" aria-label="Read more about [wpbb post:title]" class="modal-btn" data-toggle="modal" data-target="#[wpbb post:slug]"> | |
Learn More <span class="sr-only">about [wpbb post:title]</span> | |
</button> | |
</div> | |
<h3 class="team-name">[wpbb post:title]</h3> | |
<p class="team-position">[wpbb post:acf type='text' name='team_position']</p> |
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_shortcode( 'first_name', 'get_first_name' ); | |
function get_first_name() { | |
$title = get_the_title(); | |
$full_name_seperate = explode( ' ', $title ); | |
return $full_name_seperate[0]; | |
} |
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 | |
// Modify the data returned for BB post module auto suggest queries to include post URLs | |
add_filter('fl_builder_auto_suggest_posts_lookup', function ( $data ) { | |
foreach ( $data as $key => $post ) { | |
$post_object = get_post( $post['value'] ); | |
// If the post object exists, append the URL path to the title | |
if ( $post_object ) { | |
$permalink = get_permalink( $post['value'] ); |
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
<?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])) { |
NewerOlder