Browse files

Merge pull request #41 from robneu/new-hooks

Added new entry content and while hooks
  • Loading branch information...
2 parents 9765ec4 + 7d66d5d commit 969c949df8c0a9740f27b88755d053762be5d283 @zamoose committed Aug 4, 2015
Showing with 47 additions and 21 deletions.
  1. +30 −20 tha-example-index.php
  2. +17 −1 tha-theme-hooks.php
View
50 tha-example-index.php
@@ -22,24 +22,34 @@
<?php tha_content_top(); ?>
<!-- This roughly encapsulates The Loop portion of the layout -->
- <?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>
+ <?php if ( have_posts() ) : ?>
- <?php tha_entry_before(); ?>
- <!-- Post Entry Begin -->
- <div <?php post_class( 'entry' ); ?>>
- <?php tha_entry_top(); ?>
- <h2><?php the_title(); ?></h2>
- <div class="itemtext">
- <?php the_content(); ?>
- </div><!-- .itemtext -->
- <?php tha_entry_bottom(); ?>
- </div>
- <!-- Post Entry End -->
- <?php tha_entry_after(); ?>
+ <?php tha_content_while_before(); ?>
- <?php endwhile; endif; ?>
+ <?php while ( have_posts() ) : the_post(); ?>
+
+ <?php tha_entry_before(); ?>
+ <!-- Post Entry Begin -->
+ <div <?php post_class( 'entry' ); ?>>
+ <?php tha_entry_top(); ?>
+ <h2><?php the_title(); ?></h2>
+ <div class="itemtext">
+ <?php tha_entry_content_before(); ?>
+ <?php the_content(); ?>
+ <?php tha_entry_content_after(); ?>
+ </div><!-- .itemtext -->
+ <?php tha_entry_bottom(); ?>
+ </div>
+ <!-- Post Entry End -->
+ <?php tha_entry_after(); ?>
+
+ <?php endwhile; ?>
+
+ <?php tha_content_while_after(); ?>
+
+ <?php endif; ?>
<!-- Close The Loop -->
-
+
<?php tha_comments_before(); ?>
<!-- Post Comments Begin -->
<?php comments_template(); ?>
@@ -49,26 +59,26 @@
<?php tha_content_bottom(); ?>
</div><!-- #content -->
<?php tha_content_after(); ?>
-
+
<?php tha_sidebars_before(); ?>
<div id="sidebar">
<?php tha_sidebar_top(); ?>
<?php dynamic_sidebar( 'sidebar' ); ?>
<?php tha_sidebar_bottom(); ?>
</div><!-- #sidebar-->
<?php tha_sidebars_after(); ?>
-
+
<?php tha_footer_before(); ?>
<div id="footer">
<?php tha_footer_top(); ?>
-
+
<h3>Footer</h3>
<p>This is some sample footer text.</p>
-
+
<?php tha_footer_bottom(); ?>
</div><!-- #footer -->
<?php tha_footer_after(); ?>
<?php tha_body_bottom(); ?>
<?php wp_footer(); ?>
</body>
-</html>
+</html>
View
18 tha-theme-hooks.php
@@ -70,7 +70,7 @@
* will be able to check whether the version of THA supplied by the theme
* supports Core hooks.
*/
-// 'core',
+ //'core',
) );
/**
@@ -171,6 +171,14 @@ function tha_content_bottom() {
do_action( 'tha_content_bottom' );
}
+function tha_content_while_before() {
+ do_action( 'tha_content_while_before' );
+}
+
+function tha_content_while_after() {
+ do_action( 'tha_content_while_after' );
+}
+
/**
* Semantic <entry> hooks
*
@@ -184,6 +192,14 @@ function tha_entry_after() {
do_action( 'tha_entry_after' );
}
+function tha_entry_content_before() {
+ do_action( 'tha_entry_content_before' );
+}
+
+function tha_entry_content_after() {
+ do_action( 'tha_entry_content_after' );
+}
+
function tha_entry_top() {
do_action( 'tha_entry_top' );
}

0 comments on commit 969c949

Please sign in to comment.