This file contains hidden or 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($){ | |
var $grid = $('.grid').isotope({ | |
itemSelector: '.grid-item', | |
percentPosition: true, | |
layoutMode: 'fitRows', | |
}); | |
// Layout Isotope after each image loads | |
$grid.imagesLoaded().progress( function() { |
This file contains hidden or 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 //<~ don't add me in - add the code below in functions.php | |
add_shortcode( 'wpb_bs_accordion_acf', 'wpb_bs_accordion_acf' ); | |
/** | |
* Bootstrap Accordion Repeater Field | |
*/ | |
function wpb_bs_accordion_acf() { | |
ob_start(); |
This file contains hidden or 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 //<~ don't add me in - code below goes into functions.php | |
add_shortcode( 'wpb_accordion_acf', 'wpb_accordion_acf' ); | |
/** | |
* Accordion Repeater Field | |
*/ | |
function wpb_accordion_acf() { | |
ob_start(); | |
// *Repeater |
This file contains hidden or 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 //<~ remove if using in functions.php | |
add_shortcode( 'login_logut', 'login_logut' ); | |
/** | |
* Add a login/logout shortcode button | |
* @since 1.0.0 | |
*/ | |
function login_logut() { | |
ob_start(); | |
if (is_user_logged_in()) : |
This file contains hidden or 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 | |
// ACF upload prefilter | |
function gist_acf_upload_dir_prefilter($errors, $file, $field) { | |
// Only allow editors and admins, change capability as you see fit | |
if( !current_user_can('edit_pages') ) { | |
$errors[] = 'Only Editors and Administrators may upload attachments'; | |
} | |
// This filter changes directory just for item being uploaded |
This file contains hidden or 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 | |
/******************************************************************************************** | |
Example for customizing the WordPress login screen using your theme's functions.php file. | |
For @halo-diehard on wordpress.org forum: | |
https://wordpress.org/support/topic/codex-unclear-regarding-custom-login-page/ | |
Relevant CODEX doc: | |
https://codex.wordpress.org/Customizing_the_Login_Form | |
*******************************************************************************************/ |
This file contains hidden or 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 | |
if ( ! function_exists( 'wpcfu_output_file_upload_form' ) ) { | |
/** | |
* Output the form. | |
* | |
* @param array $atts User defined attributes in shortcode tag | |
*/ | |
function wpcfu_output_file_upload_form( $atts ) { |
This file contains hidden or 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 | |
/** | |
* Connect Gravity Forms Multi File Upload and Advanced Custom Fields Repeating File-Field and Gallery Field | |
* REMEMBER: Set ID correctly for forms and fields AND set acf field names | |
*/ | |
add_action( 'gform_after_submission_4', 'add_form_after_submission', 10, 2 ); | |
function add_form_after_submission( $entry, $form ) { | |
//getting post | |
$post = get_post( $entry['post_id'] ); |
This file contains hidden or 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 | |
/** | |
* Create a new media library entry with a file upload on gravity form submission. | |
* @see https://joshuadnelson.com/connect-gravity-forms-file-upload-to-acf-gallery-field/ | |
* @author Joshua David Nelson, [email protected] | |
*/ | |
$gravity_form_id = 1; // gravity form id, or replace {$gravity_form_id} below with this number | |
add_filter( "gform_after_submission_{$gravity_form_id}", 'jdn_add_image_to_media_library', 10, 2 ); | |
function jdn_add_image_to_media_library( $entry, $form ) { |
This file contains hidden or 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 | |
/** | |
* Gravity Perks // GP Media Library // Auto-attach Uploaded Files to GF-generated Post | |
* http://gravitywiz.com/documentation/gp-media-library/ | |
*/ | |
add_action( 'gform_after_create_post', function( $post_id, $entry, $form ) { | |
if( is_callable( 'gp_media_library' ) ) { | |
$file_ids = gp_media_library()->get_file_ids_by_entry( $entry, $form ); | |
if( $file_ids ) { | |
foreach( $file_ids as $field_id => $_file_ids ) { |