Browse Archives: Snippets

Description.

How to remove store base from permalink in PremiumPress coupon theme

Sometimes we want to remove /store/ from the store url. We only want store name, like http://yoursite.com/amazon/ instead of http://yoursite.com/store/amazon/ This code can remove store base permalink in premiumpress coupon theme. Add this code to your current theme’s functions.php file: [php] add_filter(‘request’, ‘obs_change_term_request’, 1, 1 ); function obs_change_term_request($query){ $tax_name = ‘store’; if( $query[‘attachment’] ) : $include_children = true; $name […]

Add ‘Click to Show’ phone number button on PremiumPress Directory/Classified Themes

This will add a button Click to Show on Listing details table to show Phone Number Add this to Theme’s Custom Javascript wp_footer section [javascript] <script> jQuery(‘#TableCustomFieldsBig .val_phone a’).hide(); jQuery(‘#TableCustomFieldsBig .val_phone’).append(‘<span class="btn btn-primary" onclick="jQuery(this).hide();jQuery(this).parent().find(\’a\’).show();">Click to Show</span>’); </script> [/javascript] Demo: Website Link Visit Link Here Phone Number 123-456-789Click to Show Country India State/Province West Bengal City Atialdanga

Add Store name in coupon url in PremiumPress coupon theme

Add this to functions.php to the themes folder: [php]function obs_add_store_to_permalink( $post_link, $post ){ if ( is_object( $post ) && $post->post_type == ‘listing_type’ ){ $terms = wp_get_object_terms( $post->ID, ‘store’ ); if( $terms ){ return str_replace( ‘%store%’ , $terms[0]->slug , $post_link ); }else{ return str_replace( ‘%store%’ , ‘store’ , $post_link ); } } return $post_link; } add_filter( […]