Support » Plugin: Grid Products » Changing product permalink

  • Hi Team

    I’m looking to try and change the permalink of my products to /%custom_category%/productname – not quite sure of how to insert the additional string in. I found a post which mentioned changing the rewrite array slug to remove ‘product’ (which I’ve done, as below) – but I’m not sure which string / element to edit to insert the category into the permalink instead. Grateful for any help.

    register_post_type( 'grid_products',
    		array(
    			'labels' => array(
    				'name' => __( 'Products' ),
    				'singular_name' => __( 'Product' ),
    				 'add_new' => _x('Add New Product', 'Product'),
        'add_new_item' => __('Add New Product'),
    				'edit_item'	=>	__( 'Edit Product'),
    				 'view_item' => __('View Product'),
    				'add_new_item'	=>	__( 'Add Product')
    
    			),
    			'public' => true,
    			'menu_position' => 10,
    			'menu_icon' => plugins_url( 'images/product_edit.png', __FILE__ ),
    			'show_ui' => true,
    			'capability_type' => 'post',
    			'rewrite' => array( 'slug' => 'post', 'with_front' => false ),
    			'taxonomies' => array( 'Products '),
    			'supports' => array(
    			 'title',
    	  'editor',
    	  'excerpt',
    	  'revisions',
    	  'thumbnail',
    	  'custom-fields',
    	  'author',
    	  )

    https://wordpress.org/plugins/grid-products/

Viewing 3 replies - 1 through 3 (of 3 total)
  • Also, I’m looking to remove author and publish date from my product posts. Grateful for anyone who can tell me how to do that too!

    Cheers!

    Ash

    Plugin Contributor ModDish

    (@moddish)

    remove
    'author',

    for post date thats part of your single template

    you could just create a new single template for the post type products

    single-Products.php then lay that out and remove what you do not want displayed.

    not sure what you mean in the first part with the permalink, please clarify

    Thanks
    Evan

    Hi Evan,

    Thanks for your reply! I’d like to try and get the permalink to be

    ../categoryname/productname

    as opposed to just ‘post’ – which I have at the moment

    Check out my site as it is, at the mo – http://thtc.co.uk/about-thtc/awards

    So ideally, I’d like the permalink for each of those product to read http://thtc.co.uk/awards-accreditations/(postname)

    Thanks!

    Ash

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Changing product permalink’ is closed to new replies.