including Geo meta tags in BeTheme

Hi Guys,

Is there a way to include Geo meta tags in the <head> section without changing a source file?

Bing and Yahoo use this information to locate a business (in my case a Hotel and Restaurant)
<meta name="geo.region" content="UG-405" />
<meta name="geo.placename" content="Fort Portal" />
<meta name="geo.position" content="0.653767;30.278303" />
<meta name="ICBM" content="0.653767, 30.278303" />

Regards,
Michel

Comments

  • Hi,

    without changing source files, it is not possible.

    Thanks!
  • Hi,

    To implement the geo tags means I have to use the child-theme in order to avoid losing the code after an update?

    Maybe in a future release you can implement a "Hook" that executes after the opening the <head> tag?

    Regards,
    btw theme and support rocks!  
  • Hi,

    Solved my geo meta tag question, wordpress provides a hook to the head:

    1. installed child theme
    2. changed functions.php in child theme by adding the following at the end of the file:

    add_action('wp_head', 'geo_tags_function');
    function geo_tags_function() {
    echo ' HTML tags go here ';
    }

    Regards

  • We got the hooks under Theme options > Global > Hooks section. And this is the only place where you can put some custom code.

    Anyway, we are glad to see that you sorted it with a child theme files.
  • The hooks I've seen, however there is no hook that leads to the <head> section, and that was my suggestion to implement this in future releases.

  • Still no hook that leads to the head section?
  • No sorry, there is no possibility.
  • I would appreciate some help in adding geo meta tags. We are using a BeTheme child theme but mfkroon's instructions went over my newbie head. Is someone able to walk me through the process, step-by-step? Thank you!
  • Theme options > Global > Hooks section
    This is the only place where you can put some custom code

    What do you exacly want to know about this?
    Thanks.
  • edited September 2018
    Thank you, Pablo.  I thought geo meta tags needed to go in the <head> section, however, as mfkroon mentioned, there still is no hook that leads to the <head> section.  Therefore, my question is, where exactly should I be placing the geo tags OR mfkroon's code shown above?

    When I use the editor to open the header.php file for our child template, I see the following code in the meta section (shown below). Could I possibly place a do_action shown in red below? Thank you in advance!

    <meta charset="<?php bloginfo( 'charset' ); ?>" />
    <?php 
    if( mfn_opts_get('responsive') ){
    if( mfn_opts_get('responsive-zoom') ){
    echo '<meta name="viewport" content="width=device-width, initial-scale=1">';
    } else {
    echo '<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">';
    }
     
    }
    ?>

    <?php do_action('wp_seo'); ?>

    <?php do_action('geo_tags_function');
    function geo_tags_function() {
    echo '<meta name="geo.region" content="XXX" />';
    echo '<meta name="geo.placename" content="XXX" />';
    echo '<meta name="geo.position" content="XXX" />';
    echo '<meta name="ICBM" content="XXX" />';
    }
    ?>

    <link rel="shortcut icon" href="<?php mfn_opts_show( 'favicon-img', THEME_URI .'/images/favicon.ico' ); ?>" />
    <?php if( mfn_opts_get('apple-touch-icon') ): ?>
    <link rel="apple-touch-icon" href="<?php mfn_opts_show( 'apple-touch-icon' ); ?>" />
    <?php endif; ?>
  • Follow up comment to the one above:
    I couldn't get the action to work, so I removed it completely and used the echo function only. Works now. What would be the advantage to using a do_action (or add_action) call?
  • add_action/do_action is a function for wordpress with execute funtions hooked on specific action hook.

    It's just launching the script you made.
    Thanks
Sign In or Register to comment.