Home > Blockchain >  connect woocommerce products to pages
connect woocommerce products to pages

Time:04-19

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

  1. 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'); } }

  2. Assign authors to products (User of WordPress, WordPress by default create author page it will easy for you to use author page)

  3. On the product single page add custom code to show Author information Code Exampl:

  • Related