Skip to content

Commit f2620b6

Browse files
authored
Merge pull request #25 from artlung/supportForTagPages
Adding support for Tag Archive Pages
2 parents 88e1ebd + bd1a78d commit f2620b6

2 files changed

Lines changed: 11 additions & 2 deletions

File tree

open-graph-protocol-tools.php

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -281,7 +281,12 @@ function opengraphprotocoltools_set_data() {
281281
$meta_tags = array_merge($meta_tags,opengraphprotocoltools_image());
282282
$meta_tags = array_merge($meta_tags,opengraphprotocoltools_audio());
283283
$meta_tags = array_merge($meta_tags,opengraphprotocoltools_video());
284-
284+
elseif (is_archive() && is_tag()):
285+
$the_tag = single_tag_title('', false);
286+
$meta_tags['http://ogp.me/ns#title'] = get_bloginfo('name') . ": tag: " . $the_tag;
287+
// $meta_tags['http://ogp.me/ns#url'] = "";
288+
$meta_tags['http://ogp.me/ns#description'] = get_bloginfo('name') . " posts tagged with " . $the_tag;
289+
$meta_tags['twitter:creator'] = get_opengraphprotocoltools_author_twitter();
285290
else:
286291
$meta_tags['http://ogp.me/ns#title'] = get_bloginfo('name');
287292
$meta_tags['http://ogp.me/ns#url'] = get_bloginfo('url');

readme.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ Donate link: http://joecrawford.com/plugin-donation
44
Tags: metadata, opengraphprotocol, facebook
55
Requires at least: 2.9
66
Tested up to: 5.0
7-
Stable tag: 1.8
7+
Stable tag: 1.9
88

99
Adds Open Graph Protocol meta to the individual pages and posts of your WordPress Install.
1010

@@ -70,3 +70,7 @@ None.
7070
= 1.8 =
7171

7272
* WordPress 5 compatibility check!
73+
74+
= 1.9 =
75+
76+
* Support for tag archive pages

0 commit comments

Comments
 (0)