// This code snippet this used to sort the vendor archive located on the “Vendor Guide”. // It makes sure that featured vendors (ACF field group ‘status_ven_featured’ set to 1) appear first, // followed by paying vendors (ACF field group…Continue reading
function custom_vendor_term_link($url, $term, $taxonomy){ switch ($taxonomy) { case ‘vendor-location’: return home_url(‘/vendor/?_vendor_location=’ . $term->slug); case ‘vendor-category’: return home_url(‘/vendor/?_vendor_category=’ . $term->slug); case ‘vendor-pricing’: return home_url(‘/vendor/?_vendor_pricing=’ . $term->slug); case ‘vendor-zone’: return home_url(‘/vendor/?_vendor_zone=’ . $term->slug); case ‘vendor-identity-attribute’: return home_url(‘/vendor/?_vendor_identity_attributes=’ . $term->slug); default: return $url;…Continue reading
function custom_vendor_term_link($url, $term, $taxonomy){ switch ($taxonomy) { case ‘vendor-location’: return home_url(‘/vendor/?_vendor_location=’ . $term->slug); case ‘vendor-category’: return home_url(‘/vendor/?_vendor_category=’ . $term->slug); case ‘vendor-pricing’: return home_url(‘/vendor/?_vendor_pricing=’ . $term->slug); case ‘vendor-zone’: return home_url(‘/vendor/?_vendor_zone=’ . $term->slug); case ‘vendor-identity-attribute’: return home_url(‘/vendor/?_vendor_identity_attributes=’ . $term->slug); default: return $url;…Continue reading
// // Modifies the WP Grid Builder query to filter vendors based on matching ‘vendor-location’ // // taxonomy terms with the current post’s ‘post-location’ terms. // // This function is hooked into the WP Grid Builder’s query argument filter, //…Continue reading
add_filter(‘wppb_select_options_array’, ‘wppbc_us_states_select_options’, 20, 5); function wppbc_us_states_select_options($options, $field, $form_location, $user_id, $request_data) { if ($field[‘meta-name’] != ‘us_state’) return $options; $states = array_keys(wppbc_get_us_states()); return $states; } add_filter(‘wppb_select_labels_array’, ‘wppbc_us_states_select_labels’, 20, 5); function wppbc_us_states_select_labels($labels, $field, $form_location, $user_id, $request_data) { if ($field[‘meta-name’] != ‘us_state’) return $labels;…Continue reading
function shoutout_remove_default_styles() { // Remove default Advanced Forms styles wp_dequeue_style( ‘af-form-style’ ); // Remove default ACF styles wp_dequeue_style( ‘acf-input’ ); wp_dequeue_style( ‘acf-pro-input’ ); // Remove default ACFE styles wp_dequeue_style( ‘acf-extended’ ); wp_dequeue_style( ‘acf-extended-input’ ); wp_dequeue_style( ‘acf-extended-pro-input’ ); } add_action( ‘af/form/enqueue/key=form_64d4c0621a9c5’,…Continue reading
/* Disable WordPress Admin Bar for all users */ add_filter( ‘show_admin_bar’, ‘__return_false’ );Continue reading
function visitor_greeting() { $string = ”; // Check if cookie is already set if ( isset( $_COOKIE[‘wpb_visit_time’] ) ) { // Use information stored in the cookie $lastvisit = $_COOKIE[‘wpb_visit_time’]; $string .= ‘You last visited our website ‘ . $lastvisit…Continue reading
function enqueue_infinite_scroll_script() { ?> var pageNum = 2; // The number of the next page to load. Start from the second page. var isLoading = false; // A flag to control whether or not an AJAX request is in progress.…Continue reading
// This line is adding a custom function to the ‘login_redirect’ filter. The ‘login_redirect’ filter is applied right after a user logs in to WordPress. The custom function ‘wppbc_custom_login_redirect’ is given a priority of 10, and it accepts 3 arguments.…Continue reading