*

Ajit Sahane

  • ****
  • 156 posts
  • https://bestclassifiedsusa.com
Item title replace item meta title
« on: July 26, 2023, 05:56:37 PM »
Hello team, i want to change item title to item meta title in search page result listing place .

How to do this ..?

loop-single.php -

<h3><a class="title" href="<?php echo osc_item_url(); ?>" title="<?php echo osc_highlight(osc_item_title(), 100); ?>">
<?php echo osc_highlight(osc_item_title(), 100); ?>  </a></h3>
     <?php } ?>

premium item + free item - both title replace ais item meta title if available else normal item title want to show.


here how replace - item title - if user or admin setup custom meta title & description then its shown in item / ad page default. but in search or category page not showing.

So how to achieve these?

*

MB Themes

Re: Item title replace item meta title
« Reply #1 on: July 27, 2023, 01:33:01 PM »
You just need to find correct function in plugin to get user defined meta title
  To get fast support, we need following details: Detail description, URL to reproduce problem, Screenshots

*

Ajit Sahane

  • ****
  • 156 posts
  • https://bestclassifiedsusa.com
Re: Item title replace item meta title
« Reply #2 on: January 03, 2024, 09:52:13 PM »
Hello team, lot of try, but not done. can you give me working code.

check what i am trying to say, img screenshot check.

*

MB Themes

Re: Item title replace item meta title
« Reply #3 on: January 04, 2024, 06:26:45 PM »
Edit loop-single.php
  To get fast support, we need following details: Detail description, URL to reproduce problem, Screenshots

*

Ajit Sahane

  • ****
  • 156 posts
  • https://bestclassifiedsusa.com
Re: Item title replace item meta title
« Reply #4 on: January 04, 2024, 06:50:42 PM »
 if(isset($item_id) && $item_id > 0) {
  $detail = ModelAisItem::newInstance()->findByItemId($item_id);
 
  $title = isset($detail['s_title']) ? $detail['s_title'] : '';
  $description = isset($detail['s_description']) ? $detail['s_description'] : '';
} else {
  $title = '';
  $description = '';
}



<h4><a class="title" href="<?php echo osc_item_url(); ?>" title="<?php echo osc_highlight(osc_item_title(), 100); ?>"><?php echo osc_highlight(osc_item_title(), 100); ?></a></h4>

where code edit ...?

if you share working code, it will help a lot.

thanks.

*

MB Themes

Re: Item title replace item meta title
« Reply #5 on: January 04, 2024, 09:49:31 PM »
I would try this:
Code: [Select]
  $detail = ModelAisItem::newInstance()->findByItemId(osc_item_id());
  $title = (isset($detail['s_title']) && trim($detail['s_title'] != '')) ? $detail['s_title'] : osc_item_title();

Then
Code: [Select]
<h4><a class="title" href="<?php echo osc_item_url(); ?>" title="<?php echo osc_highlight($title100); ?>"><?php echo osc_highlight($title100); ?></a></h4>
  To get fast support, we need following details: Detail description, URL to reproduce problem, Screenshots

*

Ajit Sahane

  • ****
  • 156 posts
  • https://bestclassifiedsusa.com
Re: Item title replace item meta title
« Reply #6 on: January 04, 2024, 10:26:19 PM »
Just try but now item title not showing - title blank  no any error log.

*

MB Themes

Re: Item title replace item meta title
« Reply #7 on: January 05, 2024, 02:47:48 PM »
Then enable error reporting and correct typo in above code  :'(

Code: [Select]
  $detail = ModelAisItem::newInstance()->findByItemId(osc_item_id());
  $title = (isset($detail['s_title']) && trim($detail['s_title']) != '') ? $detail['s_title'] : osc_item_title();
  To get fast support, we need following details: Detail description, URL to reproduce problem, Screenshots

*

Ajit Sahane

  • ****
  • 156 posts
  • https://bestclassifiedsusa.com
Re: Item title replace item meta title
« Reply #8 on: January 07, 2024, 09:11:53 PM »
Try new code and error log enabled also display error On but no still Title not showing and also no any error log shown.

*

MB Themes

Re: Item title replace item meta title
« Reply #9 on: January 08, 2024, 01:07:51 PM »
It would mean place where you are putting osc_item_... functions, item is not available there / is empty.
  To get fast support, we need following details: Detail description, URL to reproduce problem, Screenshots