This topic contains a post which is marked as Best Answer. Press here if you would like to see it.
*

webcity

  • ****
  • 220 posts
Location information
« on: August 07, 2023, 06:45:02 PM »
Hi,

I use the plugin to insert extra, unique information into each category for SEO purposes.
I would like to insert the location into the text too.

For example if my search includes the City location of London, I would like to show "London my category text".

I've tried to use :
Code: [Select]
<?php
 
echo @
$loc;
}
  ?>

But this doesn't work.

Can anyone suggest the code to use to insert the location into the text of the banner code?

I also have the Seo PRO Plugin, can I use any of the plugins tags in the banner code?

Many thanks
« Last Edit: August 07, 2023, 06:55:48 PM by webcity »

*

MB Themes

Re: Location information
« Reply #1 on: August 07, 2023, 08:30:01 PM »
You coukd use like magic word {{region}} in text and then use str_relpace when showing banner text to replace with osc_search_region()
  To get fast support, we need following details: Detail description, URL to reproduce problem, Screenshots

*

webcity

  • ****
  • 220 posts
Re: Location information
« Reply #2 on: August 08, 2023, 04:56:25 AM »
Thanks for your help.

That sounds a great solution.

Could you please provide an example of the code that I could include in the search.php file to get that to work?

Kind regards,
Spencer

*

MB Themes

Re: Location information
« Reply #3 on: August 08, 2023, 09:28:38 AM »
Code: [Select]
<?php echo str_replace('{{region}}'osc_search_region(), ba_plugin_banner_function()); ?>
ba_plugin_banner_function() must be replaced with function that retrieve text of banner.
« Last Edit: August 08, 2023, 10:01:26 AM by MB Themes »
  To get fast support, we need following details: Detail description, URL to reproduce problem, Screenshots

*

webcity

  • ****
  • 220 posts
Re: Location information
« Reply #4 on: August 08, 2023, 09:55:49 AM »
Thanks again for your help.

If I'm using :
Code: [Select]
<?php echo show_banner(1); ?>

To show my banner in the template file: search.php

What would I replace ba_plugin_banner_function() with?

Kind regards,
Spencer

Marked as best answer by frosticek on August 08, 2023, 02:20:35 PM
*

MB Themes

Re: Location information
« Reply #5 on: August 08, 2023, 10:02:14 AM »
I do not recommend to do mods if you really need someone to replace functions in statement :)
Code: [Select]
<?php echo str_replace('{{region}}'osc_search_region(), show_banner(1)); ?>
  To get fast support, we need following details: Detail description, URL to reproduce problem, Screenshots

*

webcity

  • ****
  • 220 posts
Re: Location information
« Reply #6 on: August 08, 2023, 02:14:04 PM »
Thanks, it's working great :-)