*

webcity

  • *****
  • 252 posts
Code mod to help with SEO
« on: April 12, 2020, 08:27:15 AM »
Hi,

I'm using the Gamma theme - Great theme!

I'm trying to make the theme more SEO friendly. I'm using the SEO plugin too.

In the search.php code, I want to use the page title for <h1> tag for the categories.

In the code:

Code: [Select]
<h1>
            <?php 
              $loc 
array_filter(array(osc_search_city(), osc_search_region(), osc_search_city()))[0];
              
$cat = @$category['s_name'];

              if(
osc_search_total_items() <= 0) { 
                echo 
__('No listings found''gamma');

              } else if(
$cat <> '') {
                if(
$loc <> '') {
                  echo 
sprintf(__('%s in %s''gamma'), $cat$loc);
                } else {
                  echo 
sprintf(__('%s results''gamma'), $cat);
                }
              } else {
                if(
$loc <> '') {
                  echo 
sprintf(__('%s results''gamma'), $loc);
                } else {
                  echo 
__('Results''gamma');
                }
              }
            
?>

          </h1>

What do I need to change to use the page title instead of getting <h1>"Category Results"</h1> I would like <h1>"My category SEO title"</h1>?

Many thanks

Marked as best answer by frosticek on April 13, 2020, 06:04:21 PM
*

MB Themes

Re: Code mod to help with SEO
« Reply #1 on: April 12, 2020, 09:06:25 PM »
@webcity
These lines:
Code: [Select]
                if($loc <> '') {
                  echo sprintf(__('%s in %s', 'gamma'), $cat, $loc);
                } else {
                  echo sprintf(__('%s results', 'gamma'), $cat);
                }
  To get fast support, we need following details: Detail description, URL to reproduce problem, Screenshots

*

webcity

  • *****
  • 252 posts
Re: Code mod to help with SEO
« Reply #2 on: April 13, 2020, 03:36:51 PM »
Cheers :-)