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.
This website uses cookies

We use cookies to personalise content and ads, to provide social media features and to analyse our traffic. We also share information about your use of our site with our social media, advertising and analytics partners who may combine it with other information that you’ve provided to them or that they’ve collected from your use of their services.

Cookies are small text files that can be used by websites to make a user's experience more efficient.

The law states that we can store cookies on your device if they are strictly necessary for the operation of this site. For all other types of cookies we need your permission. This means that cookies which are categorized as necessary, are processed based on GDPR Art. 6 (1) (f). All other cookies, meaning those from the categories preferences and marketing, are processed based on GDPR Art. 6 (1) (a) GDPR.

This site uses different types of cookies. Some cookies are placed by third party services that appear on our pages.

You can at any time change or withdraw your consent from the Cookie Declaration on our website.

Learn more about who we are, how you can contact us and how we process personal data in our Privacy Policy.

Please state your consent ID and date when you contact us regarding your consent.