Actions

Mediawiki Google Plus +1

From Rabbi Blog

Revision as of 09:31, 12 September 2011 by Rabbi Bob (talk | contribs) (Created page with "'''References:''' [ * [http://www.google.com/webmasters/+1/button/ Google's Add +1 to your pages to help your site stand out] * [http://multiplethreads.blogspot.com/2011/07/embed...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

References: [

  • Edit LocalSettings.php and include the code provided by Googe's page above.
    • Example:
$wgHooks['BeforePageDisplay'][]  = 'MyExtensionJavaScript';
    function MyExtensionJavaScript( $out ) 
    {
    # Add Google +1
    $script = '<script type="text/javascript" language="javascript" src="https://apis.google.com/js/plusone.js">'
                    . '</script>';
    $out->addScript( $script);
    return true;
    }    
  • Edit your skin template (mine is SGuMax.php) and add <g:plusone size="small" href="/"></g:plusone>
    • Example:
<h1 class="firstHeading"><?php $this->data['displaytitle']!=""?$this->html('title'):$this->text('title') ?> <g:plusone size="small" href="/"></g:plusone></h1>