Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added new entry content and while hooks #41

Merged
merged 5 commits into from
Aug 5, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
50 changes: 30 additions & 20 deletions tha-example-index.php
Original file line number Diff line number Diff line change
Expand Up @@ -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(); ?>
Expand All @@ -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>
18 changes: 17 additions & 1 deletion tha-theme-hooks.php
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@
* will be able to check whether the version of THA supplied by the theme
* supports Core hooks.
*/
// 'core',
//'core',
) );

/**
Expand Down Expand Up @@ -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
*
Expand All @@ -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' );
}
Expand Down