Site logo

Archived topic

Adding Google Analytics - possible?

6 replies · Started by Lisa Blaushild on October 12, 2015

Viewing posts 1–7 of 7

Hi Tom,

Is it possible to add a Google Analystic ID code to my site? Or how is it done? Thanks!

Lisa
NY

Thanks, I'll get the GP Hooks add-on!

Tom,

One other thing - would the Page Header plug-in allow me to add contact info on the upper left hand corner of the home page?

Thanks.

Hi Lisa. You could add your contact info to the site heading using one of the following hooks with something like this:

<?php
  if ( is_home() ) { ?>
    <p class="contact-info">
      Contact name <br>
      Contact address <br>
      Contact phone
    </p>
<?php } ?>

1. Using the "Before Header" hook will place it in the very upper left corner of the site.
2. Using the "Before Header Content" hook will place it in the header just above the site title/description/logo.

Check the "Execute PHP" option box. Then you can position/style it as needed using CSS.

If you wanted the contact info at the top of the Home page content section then you could put this in the Blog Page Header Content:

<p class="contact-info">
  Contact name <br>
  Contact address <br>
  Contact phone
</p>

Adding CSS: https://generatepress.com/knowledgebase/adding-css/

Okay, thank you!

Lisa

You're welcome :)

This archived topic is closed to new replies.