| 1 | <?php |
|---|
| 2 | /** |
|---|
| 3 | * Plugin Name: Theme Hooks Test |
|---|
| 4 | */ |
|---|
| 5 | |
|---|
| 6 | class Theme_Hooks_Test_Plugin { |
|---|
| 7 | function __construct() { |
|---|
| 8 | add_action( 'header_after', array( $this, 'header_after_social_profiles' ) ); |
|---|
| 9 | add_action( 'header_after', array( $this, 'header_after_breadcrumbs' ) ); |
|---|
| 10 | |
|---|
| 11 | add_action( 'post_after', array( $this, 'post_after_social_sharing' ) ); |
|---|
| 12 | add_action( 'post_after', array( $this, 'post_after_related_posts' ) ); |
|---|
| 13 | add_action( 'post_after', array( $this, 'post_after_author_bio' ) ); |
|---|
| 14 | add_action( 'post_after', array( $this, 'post_after_ratings' ) ); |
|---|
| 15 | |
|---|
| 16 | add_action( 'comment_after', array( $this, 'comment_after_rating' ) ); |
|---|
| 17 | } |
|---|
| 18 | |
|---|
| 19 | function header_after_breadcrumbs() { |
|---|
| 20 | ?> |
|---|
| 21 | <div class="header-after breadcrumbs" style="clear: both;"> |
|---|
| 22 | <a href="<?php echo home_url(); ?>">Home</a> → <a href="#">WordPress</a> → <a href="#">Themes</a> → <a href="#">Twenty Twelve</a> |
|---|
| 23 | </div> |
|---|
| 24 | <?php |
|---|
| 25 | } |
|---|
| 26 | |
|---|
| 27 | function header_after_social_profiles() { |
|---|
| 28 | ?> |
|---|
| 29 | <div class="header-after social-profiles" style="clear: both;"> |
|---|
| 30 | <a href="#">Twitter</a> |
|---|
| 31 | <a href="#">Facebook</a> |
|---|
| 32 | <a href="#">Linked In</a> |
|---|
| 33 | </div> |
|---|
| 34 | <?php |
|---|
| 35 | } |
|---|
| 36 | |
|---|
| 37 | function post_after_social_sharing() { |
|---|
| 38 | ?> |
|---|
| 39 | <div class="post-after share-this"> |
|---|
| 40 | <h4>Share This Post</h4> |
|---|
| 41 | <img src="http://f.cl.ly/items/0b460v0M0Q2r423F3y2L/Screen%20Shot%202012-08-07%20at%203.15.51%20AM.png" /> |
|---|
| 42 | </div> |
|---|
| 43 | <?php |
|---|
| 44 | } |
|---|
| 45 | |
|---|
| 46 | function post_after_related_posts() { |
|---|
| 47 | ?> |
|---|
| 48 | <div class="post-after related-posts"> |
|---|
| 49 | <h4>Related Posts</h4> |
|---|
| 50 | <ul> |
|---|
| 51 | <li><a href="#">Lorem ipsum dolor sit amet</a></li> |
|---|
| 52 | <li><a href="#">Consectetur adipisicing elit, sed do eiusmod</a></li> |
|---|
| 53 | <li><a href="#">Tempor incididunt ut labore et dolore magna aliqua</a></li> |
|---|
| 54 | <li><a href="#">Ut enim ad minim veniam</a></li> |
|---|
| 55 | <li><a href="#">Quis nostrud exercitation ullamco laboris nisi ut aliquip</a></li> |
|---|
| 56 | </ul> |
|---|
| 57 | </div> |
|---|
| 58 | <?php |
|---|
| 59 | } |
|---|
| 60 | |
|---|
| 61 | function post_after_author_bio() { |
|---|
| 62 | ?> |
|---|
| 63 | <div class="post-after author-bio"> |
|---|
| 64 | <h4>About the Author</h4> |
|---|
| 65 | <div class="alignleft"><?php echo get_avatar( get_the_author_meta('ID') ); ?></div> |
|---|
| 66 | <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod |
|---|
| 67 | tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, |
|---|
| 68 | quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo |
|---|
| 69 | consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse |
|---|
| 70 | cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non |
|---|
| 71 | proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</p> |
|---|
| 72 | </div> |
|---|
| 73 | <?php |
|---|
| 74 | } |
|---|
| 75 | |
|---|
| 76 | function post_after_ratings() { |
|---|
| 77 | ?> |
|---|
| 78 | <div class="post-after rate-this-post"> |
|---|
| 79 | Rate: <img src="http://f.cl.ly/items/451Q1I3N1I400Q0F3K46/Screen%20Shot%202012-08-07%20at%203.30.32%20AM.png" /> |
|---|
| 80 | </div> |
|---|
| 81 | <?php |
|---|
| 82 | } |
|---|
| 83 | |
|---|
| 84 | function comment_after_rating() { |
|---|
| 85 | ?> |
|---|
| 86 | <div class="comment-after rate-this-comment"> |
|---|
| 87 | Rate: <img src="http://f.cl.ly/items/451Q1I3N1I400Q0F3K46/Screen%20Shot%202012-08-07%20at%203.30.32%20AM.png" width="60" /> |
|---|
| 88 | </div> |
|---|
| 89 | <?php |
|---|
| 90 | } |
|---|
| 91 | } |
|---|
| 92 | new Theme_Hooks_Test_Plugin; |
|---|