• Resolved Reobed

    (@reobed)


    Hello Greg,

    The listing per location is great, it works as designed and the url is good as wel as the title. For SEO reasons I would like to have a H1 header displaying also the location and some text like :

    <h1>
    All Lost and Found Objects in <locationname>.
    </h1>

    Where <locationname> changes with the location ofcourse ??

    Before digging in the code and make errors and blow up my site, what can you recommend I should do and where in the code can I make such a change without the risk that I lose it when I upgrade the WP-Adverts. Thanks in advance.

    The page I need help with: [log in to see the link]

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author Greg Winiarski

    (@gwin)

    Hi,
    to do that you can add the code below in your theme functions.php file

    
    add_action( "adverts_sh_list_before", function( $params ) {
      if( is_tax( 'advert_location' ) && get_queried_object()->term_id ) {
        echo sprintf( "<h1>All Lost and Found Objects in %s.</h1>",  get_queried_object()->name );
      }
    } );
    
    Thread Starter Reobed

    (@reobed)

    Works perfect. My compliments again for your help, speed and nice code. Clean as ever !!
    Thanks !!!

    SOLVED !

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Location H1 Header for SEO’ is closed to new replies.