The Altmetric WordPress plugin provides Altmetric embedded badge support to your WordPress blog.
<script type='text/javascript' src='https://d1bxh8uas1mnw7.cloudfront.net/assets/embed.js'></script>
altmetric-embeds
directory into your wp-content/plugins
directoryNow the plugin is activated, you can add Altmetric embedded badges to your blog posts. The format of the shortcode you need to insert is as follows:
[altmetric doi="10.1038/nature.2012.9872"]
Which means - add an embedded donut for the Nature article with a DOI of 10.1038/nature.2012.9872
.
The only required attribute is some kind of article identifier. You can use any that the Altmetric API can understand: doi, pmid, arxiv_id and handle at present.
[altmetric doi="10.1038/nature.2012.9872"]
[altmetric arxiv_id="1209.4191"]
[altmetric pmid="21771119"]
[altmetric handle="2022/14471"]
The type attribute controls which type of embedded badge to include. The choices are: donut
, medium-donut
, large-donut
, 1
and 4
. Please refer to the badge types documentation to see what they look like.
For example if you want a large-donut (180px x 180px):
[altmetric doi="10.1038/nature.2012.9872" type="large-donut"]
You can add a popover to the embedded badge:
[altmetric doi="10.1038/nature.2012.9872" popover="right"]
The value is where you want the popover to appear relative to the badge. Valid values are left, right, top and bottom.
You can add the details to the embed like so:
[altmetric doi="10.1038/nature.2012.9872" details="right"]
Currently, details can only be on the right and you can’t mix popover
and details
(it’s either or) - popover
takes priority.
If you want to float the entire badge on the page, you can add a float attribute:
[altmetric doi="10.1038/nature.2012.9872" float="right"]
This will float the entire element to the right. Valid values are left, right and none.
You can combine any and all of the above attributes, the only required one is an identifier - doi, arxiv_id, pmid, handle.
[altmetric doi="10.1038/nature.2012.9872" float="right" popover="left" style="box-shadow: 0 1px 4px rgba(0, 0, 0, 0.2);" class="someclass" type="1"]
The above will embed a 110px x 20px badge, floated on the right with a popover (with more details) appearing on the left. It also adds a box shadow around the element, adds a custom CSS class (for further styling).
The Altmetric WordPress Plugin is licensed under the GPL v2 or later.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2, as published by the Free Software Foundation.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
The Altmetric WordPress plugin was created by Will Roe.