This repository has been archived by the owner on May 9, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
/
howto.txt
67 lines (36 loc) · 1.83 KB
/
howto.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
## Installing the plugin
## Adding hNews to an hAtom-supporting theme
hNews builds upon the [hAtom][1] microformat. Luckily, many wordpress
themes already support hAtom, so most of the work is already done for
you.
You'll first need to add an `hnews` class to the post, alongside the
existing `hentry`. In most modern themes, this is handled by
the [post_class][2] template tag, so look through the theme files
for:
<div id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
and change it to:
<div id="post-<?php the_ID(); ?>" <?php post_class('hnews'); ?>>
For themes that don't use `post_class()`, you'll instead see something like:
<div id="post-<?php the_ID();?>" class="post hentry">
Change it to:
<div id="post-<?php the_ID();?>" class="post hentry hnews">
TODO: list likely php files, using twentyten as an example.
You then need to tell your theme to output the hNews-specific fields -
license, principles, dateline (geo) and source organization. This can
be done with a single call to `hnews_meta()`. Just insert this line:
<?php if (function_exists('hnews_meta')) hnews_meta(); ?>
This should be inside the `hnews` div, and outside the
`entry-content` div (you don't want the hnews data to be
treated as part of the content text).
If you're using an off-the-shelf wordpress theme, it's probably worth
implementing your hNews-supporting version of it as a [child theme] [4].
This will make it easier to track any future updates to the original
theme.
[1]: http://microformats.org/wiki/hatom
"hAtom specification"
[2]: http://codex.wordpress.org/Template_Tags/post_class>
"wordpress post_class() documentation"
[3]: http://blog.no-panic.at/2006/11/16/hatom-and-wordpress/
"tutorial on adding hAtom to a wordpress theme"
[4] http://codex.wordpress.org/Child_Themes
"About child themes in wordpress"