Archives: Snippets
Accuracy Gauge
MFP > Deploy Show & Get Data
add_action(‘acf/save_post’, ‘add_show_children’); function add_show_children($post_id) { if (defined(‘DOING_AUTOSAVE’) && DOING_AUTOSAVE) return $post_id; if (!wp_is_post_revision($post_id) && ‘show’ == get_post_type($post_id) && ‘auto-draft’ != get_post_status($post_id) && ‘draft’ == get_post_status($post_id) ) { if (0 == get_post($post_id)->post_parent) { $countInt = (int) 1; $count = (string) $countInt;…Continue reading
Hiltop Desktop Ads Popup
Add Sticky Header – Astra Free
/*Make Header Sticky*/ .site-header { position: fixed; top: 0; width: 100%; } /*Adjust Content Padding*/ .site-content { padding-top: 170px; } /*Adjust Content Padding for Mobile*/ @media (max-width: 800px) { .site-content { padding-top: 100px; } /*Stick the Off-Canvas Navigation Menu –…Continue reading
HillTop Multi Tag: In-page Push
How to Automatically Redirect If User Is Already Logged In
/** * Automatic redirect from login form if a user is already logged in * * @link https://wpforms.com/developers/how-to-automatically-redirect-if-user-is-already-logged-in/ */ function redirect_to_specific_page() { // enter the page ID of the page that contains the login form $page_id = 345; // Change…Continue reading
How to Add an Input Mask to the International Postal Code
/* * Custom input mask for the address field’s international scheme. * * @link https://wpforms.com/developers/how-to-add-an-input-mask-to-the-international-postal-code */ function wpf_dev_address_field_properties( $properties, $field, $form_data ) { if($field[ ‘scheme’ ] === ‘international’) { $properties[ ‘inputs’ ][ ‘postal’ ][ ‘class’ ][] = ‘wpforms-masked-input’; $properties[ ‘inputs’…Continue reading
How to Use Conditional Logic With a Date Picker
/** * Use conditional logic with a date field to show or hide another form field * * @link https://wpforms.com/developers/how-to-use-conditional-logic-with-a-date-picker/ */ add_action( ‘wp_head’, function () { ?>Continue reading
How to Disable Browser Autocomplete for Form Fields – specific fields
/** * Disable autocomplete for a specific form and field ID * * @link https://wpforms.com/developers/disable-browser-autocomplete-for-form-fields/ */ function wpf_disable_email_autocomplete( $properties, $field, $form_data ) { // This check will only disable autocomplete for Field #3 inside Form #11. // Removing this check…Continue reading