function al_product_adder_page_template($template) { if (is_ic_catalog_page()) { if (is_archive() || is_search() || is_tax()) { $product_archive = get_product_listing_id(); if (!empty($product_archive)) { wp_redirect(get_permalink($product_archive)); exit; } } else { return get_page_php_path(); } } return $template; }
function al_product_adder_page_template($template) { if ('al_product' == get_quasi_post_type()) { if (is_archive() || is_search() || is_tax()) { $product_archive = get_product_listing_id(); wp_redirect(get_permalink($product_archive)); } else { return get_page_php_path(); } } return $template; }