update meta tag title to the category name

Modern e-commerce WordPress theme to build successful online store with WooCommerce support.
GK User
Mon Oct 21, 2013 6:01 am
Hi ,

I am wanting to update meta tag title from the product title to the category title for the single-product page. Can anyone please give advice?

<meta name="og:title" content="category name" />

regards
Michael
User avatar
Junior Boarder

GK User
Mon Oct 21, 2013 7:38 am
Hi,

You can edit gavern/helpers/helpers.features.php file and change this function
Code: Select all
function gavern_add_og_meta_box() {
    add_meta_box(
      'gavern_og_meta_box',
      'Open Graph metatags',
      'gavern_show_og_meta_box',
      'post',
      'normal',
      'high'
   );
   
   add_meta_box(
      'gavern_og_meta_box',
      'Open Graph metatags',
      'gavern_show_og_meta_box',
      'page',
      'normal',
      'high'
   );
}


to:
Code: Select all
function gavern_add_og_meta_box() {
    add_meta_box(
      'gavern_og_meta_box',
      'Open Graph metatags',
      'gavern_show_og_meta_box',
      'post',
      'normal',
      'high'
   );
   
   add_meta_box(
      'gavern_og_meta_box',
      'Open Graph metatags',
      'gavern_show_og_meta_box',
      'page',
      'normal',
      'high'
   );
   
   add_meta_box(
      'gavern_og_meta_box',
      'Open Graph metatags',
      'gavern_show_og_meta_box',
      'product',
      'normal',
      'high'
   );
}


then you'll be able to change meta tags from the backend.
User avatar
Moderator

GK User
Sun Oct 27, 2013 11:05 pm
thanks Piotr, perfect solution:)
User avatar
Junior Boarder


cron