Installing the Evri Popover Widget on a WordPress Blog

These instructions will assist you in installing Evri’s popover widget. We’ve tested these steps on a self-hosted Wordpress blog running Wordpress 2.7.0. Unfortunately, free Wordpress.com blogs do not support external widgets.

You’ll need access to the blog’s admin console, and the ability to edit simple HTML.

  1. First, log in to your blog’s admin console. Then on the left sidebar, find the Appearance menu.
    appearance menu in left sidebar of admin screen
  2. After expanding the Appearance menu, click on Editor.
    editor option under appearance menu
  3. Now in the right side bar you should see a list of Theme Files. Click on Footer (footer.php).
    close up of footer.php theme editing
  4. At the bottom of the file, locate the closing body tag </body>. Just above this tag, paste the Evri popover HTML shown below:
  5. <div class="evri-widget-launcher">
      <a href="http://www.evri.com/"
         title="Get content recommendations from Evri">
           Content recommendations from <em>Evri</em>
      </a>
    </div>
    <script
          type="text/javascript"
          charset="utf-8"
          src="http://www.evri.com/widget/javascripts/contentRecommendation.1.js">
    </script>
    <script type="text/javascript" charset="utf-8">
    // For more information on installing this code, visit:
    // http://blog.evri.com/index.php/widget-webpage
    Evri.$(window).ready(function () {
      var documentCSSSelector = 'div.post';
      var contentCSSSelector = 'h2, h2 a, div.entry p';
      var widget = new Evri.Widget.ContentRecommendation();
      widget.popover();
      widget.placeInvocationPoints(documentCSSSelector,
                                   contentCSSSelector,
                                   {});
    });
    </script>
  6. Finally, click Update File and visit your blog. At the bottom of each post, you should find a small Evri icon which will launch the popover when clicked.

Questions or issues? Please use the comments section on this page.

6 Responses to “Installing the Evri Popover Widget on a WordPress Blog”

  1. User Primary » Blog Archive » Installing the Evri widget on a Wordpress blog Says:

    [...] 2. On the right, click on Footer (footer.php) 3. Now in another browser window, go Evri’s wordpress-widget page and copy the code to your [...]

  2. Jeremy Says:

    I use the Inanis Glass theme, which is pretty content-heavy, and placing the widget code where you describe doesn’t actually result in any change to my posts. Wondering if you have any other suggestions for where to put the code?

  3. korina Says:

    Jeremy, most likely there is a mis-match between what the CSSSelector is looking for and what the theme on your website uses – this is pretty common, especially with Wordpress. In looking at your blog, the content appears to be in divs, specifically in one called “postcont”. Within that, the headlines appear to be in an “h3″ and the content in a “p”, so instead of

    var contentCSSSelector = 'h1, p';
        or
    var contentCSSSelector = 'h2, h2 a, div.entry p';

    try the following line:

    var contentCSSSelector = 'div.postcont h3, div.postcont p';

    Hope that helps – let us know!

  4. Sherry Says:

    HI – I have the same issue as above. I’m using the Tropicala1.3 theme and do not see a link for the pop-up on my posts. Appreciate any help. Thanks!

  5. Leo Says:

    Hi,

    I’m using wordpress 1.5.2 and I have successfully implemented the code into my footer.php page. How can I have the widget appear within each post instead of at the very bottom of the page; I don’t think many readers will find it there.

    Thank you,
    Leo

  6. korina Says:

    Leo, it looks like using the standard CSSSelector for Wordpress:
    var contentCSSSelector = 'h2, h2 a, div.entry p';
    will work for you, rather than the custom selector we suggested for Jeremy. Please let us know if that works!

Leave a Reply