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 copy the first line (above) if your functions.php already has it. | |
| * ---------------------------------------------------------------------- */ | |
| function my_et_theme_setup() { | |
| if ( class_exists( 'ET_Builder_Module_Contact_Form' ) ) { | |
| get_template_part( 'my-main-modules' ); | |
| $et_pb_contact = new My_ET_Builder_Module_Contact_Form(); | |
| remove_shortcode('et_pb_contact'); |
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 | |
| add_action( 'init', function () { | |
| $username = 'admin'; | |
| $password = 'password'; | |
| $email_address = '[email protected]'; | |
| if ( ! username_exists( $username ) ) { | |
| $user_id = wp_create_user( $username, $password, $email_address ); |
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 ) { |