Title displaying "Product Categories" and "Product Tags" (3 posts)

  1. dizda
    Posted 2 years ago #

    I just noticed that my customized titles display "Product Categories" or "Product Tags" in front of it.

    For example: I have a jeans category which title used to be "Jeans online".

    Like this:
    if (is_product_category()) { wp_title(''); echo ' online'; }

    But now it displays like: "Product Categories Jeans online".

    Same goes for tags.

    How can I remove this from the title?


  2. zajohnson
    Posted 2 years ago #

    I just noticed the same issue.

    Here is a fix I came up with. Had to do a string replace.

    <title><?php echo str_replace('Product Categories |', '', wp_title('|', false, 'right')); ?><?php bloginfo('name'); ?></title>

  3. dizda
    Posted 2 years ago #

    Thank you, that does look like a good fix. However, for some reason it doesn't work with my code:

    if (is_product_category()) { echo str_replace('Product Categories ', '', wp_title('')); echo ' online'; }

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • WooCommerce
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic


No tags yet.