Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 'rewrite' => array(
- 'slug' => 'catalog/%product-cat%',
- 'with_front' => false
- ),
- add_filter('post_type_link', 'product_type_permalink', 10, 4);
- //session_product is the custom field in the session CPT that references a product
- if (!empty(get_post_meta( $id, 'session_product', true ))) {
- //gets the product id
- $id_product = get_post_meta( $id, 'session_product', true );
- //gets the product title
- $title_product = get_the_title($id_product);
- //gets the permalink
- $permalink_product = get_post_permalink($post = $id_product, $leavename = false);
- }
- catalog/%product-cat%/a-custom-post
Advertisement
Add Comment
Please, Sign In to add comment