Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/larttyler/metatag
A metadata tagging system for Wordpress
https://github.com/larttyler/metatag
Last synced: 4 days ago
JSON representation
A metadata tagging system for Wordpress
- Host: GitHub
- URL: https://github.com/larttyler/metatag
- Owner: LartTyler
- License: gpl-2.0
- Created: 2014-06-26T14:56:25.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2014-09-11T21:02:12.000Z (about 10 years ago)
- Last Synced: 2023-04-03T21:56:01.562Z (over 1 year ago)
- Language: PHP
- Size: 172 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Usage
In your page or post, simply add the metatag shortcode:
```
[meta name="title" value="Metatag Demo!"]
[meta name="author" value="Tyler Lartonoix"]
Your post content as usual.
```In order to gain access to the meta values in your template files (or anywhere else, for that matter) all you need to do is obtain the post content. Metatag hooks into Wordpress's do_shortcode handler to obtain the meta values when the content is parsed. So, an example template file might look like this:
```
= Metatag->get('title', 'Untitled') ?>
Authored by = Metatag->get('author', 'anonymous') ?>
= $content ?>
```Any values found by Metatag are obtained via the MetaTag#get method, which accepts a key as the first argument, and a default value as an optional second argument. If a default value is not provided, `null` is used.