I am using woocommerce on my wordpress site. I am selling artwork. The products are arts. I have a list of artists as pages. Each artist is one page. I would like to connect the pages and products so I can show the artist's name on the art page and the user can click on the name and it takes them to the artist page. How do I do this
CodePudding user response:
There are multiple ways to do this, But I will show you a custom way to do it
Enable the Author meta box for WooCommerce products by adding the below code in your active theme's functions.php
add_action('init', 'ehi_add_author_woocommerce', 999 ); function ehi_add_author_woocommerce() { if (post_type_exists('product')) { add_post_type_support('product', 'author'); } }
Assign authors to products (User of WordPress, WordPress by default create author page it will easy for you to use author page)
On the product single page add custom code to show Author information Code Exampl: