*

Smithtech

  • ****
  • 219 posts
ITEM META TAGS ISSUES
« on: February 16, 2023, 02:19:31 PM »
Hi,

realized issues with the newer versions of the All in one SEO plugin.

When meta titles and descriptions are not defined, the plugin skips the parameters and shows empty.
 
For example when you check the setting in this screenshot, the plugin starts echoing the meta description from the category name like this

Description: .for sale>>custom text
Title:

The issue is that when meta description is empty, plugin doesn't fall back to default description.


*

MB Themes

Re: ITEM META TAGS ISSUES
« Reply #1 on: February 17, 2023, 10:19:54 AM »
Problem could be in functions.php in these codes:
Code: [Select]
      case 'item_meta_title':
        $tag[] = trim(isset($item_meta['s_title']) ? trim($item_meta['s_title']) : trim(osc_item_title()));
        break;


      case 'item_meta_description':
        $tag[] = trim(isset($item_meta['s_description']) ? trim($item_meta['s_description']) : trim(osc_highlight(osc_item_description(), 120)));
        break;

change to this:
Code: [Select]
      case 'item_meta_title':
        if(isset($item_meta['s_title']) && trim($item_meta['s_title']) <> '') {
          $tag[] = trim($item_meta['s_title']);
        } else {
          $tag[] = trim(osc_item_title());
        }
        break;


      case 'item_meta_description':
        if(isset($item_meta['s_description']) && trim($item_meta['s_description']) <> '') {
          $tag[] = trim($item_meta['s_description']);
        } else {
          $tag[] = trim(osc_highlight(osc_item_description(), 120));
        }
        break;
  To get fast support, we need following details: Detail description, URL to reproduce problem, Screenshots