Disable Author Archive

/* Get Statuscode 404 for existing & non-existing author archives. */ add_action( ‘template_redirect’, function() { if ( isset( $_GET[‘author’] ) || is_author() ) { global $wp_query; $wp_query->set_404(); status_header( 404 ); nocache_headers(); } }, 1 ); /* Remove the Author Links…Continue reading

Rank Math

// Change OG title for Rank Math on Vendor Pages function wcv_rankmath_change_og_title( $title ) { WC_Vendors::log( $title ); if ( WCV_Vendors::is_vendor_page() ) { $vendor_shop = urldecode( get_query_var( ‘vendor_shop’ ) ); $vendor_id = WCV_Vendors::get_vendor_id( $vendor_shop ); $shop_title = get_user_meta( $vendor_id, ‘pv_shop_name’,…Continue reading

Yoast SEO

// Change OG title for Yoast on Vendor Pages function wcv_wpseo_change_og_title( $title ) { if ( WCV_Vendors::is_vendor_page() ) { $vendor_shop = urldecode( get_query_var( ‘vendor_shop’ ) ); $vendor_id = WCV_Vendors::get_vendor_id( $vendor_shop ); $shop_title = get_user_meta( $vendor_id, ‘pv_shop_name’, true ); $og_title =…Continue reading

Display Post and Page IDs in WordPress Columns

// // Add custom columns to post and page lists function custom_add_id_columns($columns) { $columns[‘post_id’] = ‘ID’; // For Posts $columns[‘page_id’] = ‘ID’; // For Pages return $columns; } add_filter(‘manage_posts_columns’, ‘custom_add_id_columns’); add_filter(‘manage_pages_columns’, ‘custom_add_id_columns’); // Populate the custom columns with IDs function…Continue reading

Add Custom Taxonomy to Woocommerce Single Product Page

add_action( ‘woocommerce_product_meta_end’, ‘wcv_add_brands_single_product’ ); function wcv_add_brands_single_product() { global $product; $taxonomy = ‘wcv_brands’; // The custom taxonomy as defined during our register_taxonomy code above. if( ! taxonomy_exists( $taxonomy ) ){ return; // exit } $term_ids = wp_get_post_terms( $product->get_id(), $taxonomy, array(‘fields’ =>…Continue reading

Add Custom Taxonomy – Multiple Vendor Taxonomy

/** * Add the custom taxonomy to the WC Vendors Pro dashboard. * */ function wcv_add_brands_field( $object_id ){ WCVendors_Pro_Form_helper::select2( array( ‘post_id’ => $object_id, ‘id’ => ‘_wcv_custom_taxonomy_wcv_brands[]’, ‘class’ => ‘select2’, ‘custom_tax’ => true, ‘label’ => __( ‘Brand’, ‘wcvendors-pro’ ), ‘taxonomy’ =>…Continue reading

Add Custom Taxonomy – Single Vendor Taxonomy

/** * Add the custom taxonomy to the WC Vendors Pro dashboard. * */ function wcv_add_brands_field( $object_id ){ WCVendors_Pro_Form_helper::select2( array( ‘post_id’ => $object_id, ‘id’ => ‘_wcv_custom_taxonomy_wcv_brands[]’, ‘class’ => ‘select2’, ‘custom_tax’ => true, ‘label’ => __( ‘Brand’, ‘wcvendors-pro’ ), ‘taxonomy’ =>…Continue reading