• Resolved nebuloushomosapien

    (@nebuloushomosapien)


    <?php
    
    /* POST TYPE */
    
    add_action('init','create_product_post_type');
    function create_product_post_type() {
    	// Labels
    	$labels = array(
    		'name' => __('Products','framework'),
    		'singular_name' => __('Product','framework'),
    		'add_new' => __('Add new','framework'),
    		'add_new_item' => __('Add new product','framework'),
    		'edit_item' => __('Edit','framework'),
    		'new_item' => __('New product','framework'),
    		'view_item' => __('View product','framework'),
    		'search_items' => __('Search product','framework'),
    		'not_found' =>  __('No product found','framework'),
    		'not_found_in_trash' => __('No product found in trash','framework'),
    		'parent_item_colon' => '',
    		'menu_name' => __('Products','framework')
    	);
    
    	$short_url = (get_option('tz_products_short_url') != '') ? get_option('tz_products_short_url') : 0;
    	$slug_first_part = ((get_option('tz_custom_products_slug') != '') ? get_option('tz_custom_products_slug') : 'product');
    	if($short_url == 1) {
    		$slug = $slug_first_part;
    	} else {
    		$slug = $slug_first_part."/%product_category%/%product_brand%";
    	}

    Could this be a reason for having a vanilla ice creams URL on my site as

    http://www.mysite.com/product/vanilla-ice-cream

    when I desperately want it to be

    http://www.mysite.com/vanilla-ice-cream

    ?? if yes what needs to be changed??

Viewing 6 replies - 1 through 6 (of 6 total)
Viewing 6 replies - 1 through 6 (of 6 total)

The topic ‘Is this code right?’ is closed to new replies.