Skip to content

Instantly share code, notes, and snippets.

@tdrayson
tdrayson / fluent-form-dropzone.css
Last active March 30, 2024 13:00
Fluent Form Custom Dropzone Styling (File / Image Upload field)
/*
Add class 'dropzone' to the upload fields that you would like to have this styling
*/
.fluentform .dropzone .ff_upload_btn.ff-btn {
color: #646c7f;
padding: 3rem;
width: 100%;
border: 2px dashed #0087f7;
border-radius: 5px;
background: rgba(223, 240, 255, 0.13);
@tdrayson
tdrayson / custom-function.php
Last active September 25, 2022 11:21
Automatically call custom functions in Generateblocks Dynamic Data
/*
* @function Automatically call custom functions in Generateblocks Dynamic Data
* @author Taylor Drayson
* @since 22/09/2022
*
* Replace $key with your unique prefix for all custom functions
*/
add_filter( 'generateblocks_dynamic_content_output', function( $content, $attributes ) {
if ( 'post-meta' === $attributes['dynamicContentType'] && isset( $attributes['metaFieldName'] ) ) {
@tdrayson
tdrayson / populate-dropdown.php
Created August 23, 2022 09:54
Populate ACF dropdown with Fluent forms
<?php
/*
Instructions
Replace YOUR_ACF_FIELD with the name of your acf select dropdown key
Add to functions.php or code snippets plugin
Forms will load sorted by Title in ASC order (A to Z)
<?php
//Add to Advanced Scripts
add_shortcode( 'repeater_post_class', 'lit_post_class_sc' );
/**
* Shortcode for adding post classes inside Oxygen Repeater
*/
function lit_post_class_sc( $atts, $content = null ) {
$postclasses = join( ' ', get_post_class() );
@tdrayson
tdrayson / FF-image-radio-field.css
Last active June 27, 2022 05:29
Fluent Forms Image Radio Field CSS
/**
* Styles the Radio field as clickable image for Fluent Forms
*
* Use: Paste into Custom CSS Section of your Form
* Add class "fancy-input" to container of all inputs that need the fancy styling
*
* Forked version of Sebastian Berger from inital post Fluent Forms FB Group - https://bit.ly/37BBpet
* FB Post - https://bit.ly/2ZEn2BG
*
* Full Links at bottom
/*
* Add post object field on the CPT you want to display
* In the post object field select the CPT post you want this post to show on
*
* Example:
* 2 CPT's - Tours and Reviews
*
* To show reviews on the relevant tours:
* - Add the post object field to the reviews CPT
* - Select the tours that I want the reviews to show on inside the Review post
@tdrayson
tdrayson / FF-responsive-payment-summary-table
Last active September 18, 2021 17:21
Make the Fluent Forms Payment Summary Table Responsive for smaller devices like Mobile
/* Start of Payment Summary Table CSS */
@media only screen and (max-width: 530px) {
.fluentform .ffp_table thead{
display:none;
}
.fluentform table{
display: block;
}
//Get the Custom Post Type
// -1 means we get all the posts type.
<?php
$things = get_posts(['post_type' => 'CPT','posts_per_page' => -1]);
//Start with 0 calories
$total = 0;
//Then Loop through all the posts in your CPT
Foreach($LotsofPosts as $singlePost):
//well grab the calories from each post
/*Put this in the header*/
html{visibility: hidden;opacity:0;}
/*Put this in the footer*/
html {
visibility: visible;
opacity: 1;
}