Month: June 2016

Remove custom post type slug from URL

For our customization want to remove custom post type slug from url then place the following snippet in functions.php within your theme folder!. add your custom post type slug instead of custom-post-slug.

function remove_custom_post_type_slug( $post_link, $post, $leavename ) {

    $post_link = str_replace( '/custom-post-slug/', '/', $post_link );

    return $post_link;
}
add_filter( 'post_type_link', 'remove_custom_post_type_slug', 10, 3 );

Have any doubt, then comment here!

Add specific country to woocommerce country list

For our customization want to add specific country to woocommerce country list then place the following snippet in functions.php within your theme folder!.

function woo_add_specific_country( $country ) 
{
   unset($country["US"]);
   return $country; 
}
add_filter( 'woocommerce_countries', 'woo_add_specific_country', 10, 1 );

Have any doubt, then comment here!

Remove specific country from woocommerce country list

For our customization want to remove specific country from woocommerce country list then place the following snippet in functions.php within your theme folder!.

function woo_remove_specific_country( $country ) 
{
   unset($country["US"]);
   return $country; 
}
add_filter( 'woocommerce_countries', 'woo_remove_specific_country', 10, 1 );

Have any doubt, then comment here!