Skip to content

Commit

Permalink
* **New** - Hooks before content and after content
Browse files Browse the repository at this point in the history
* **Tweak** - Yoast breadcrumb now hooked to before content hook
  • Loading branch information
nicomollet committed Oct 6, 2017
1 parent e390211 commit 6a0dfbb
Show file tree
Hide file tree
Showing 12 changed files with 158 additions and 12 deletions.
17 changes: 16 additions & 1 deletion 404.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,27 @@

<div id="content" role="main">

<?php if ( function_exists( 'yoast_breadcrumb' ) ) : yoast_breadcrumb(); endif; ?>
<?php
/**
* stormbringer_content_before hook.
*
* @hooked stormbringer_breadcrumb - 10
*/
do_action( 'stormbringer_content_before' );
?>

<?php
get_template_part( 'content', 'none' );
?>

<?php
/**
* stormbringer_content_after hook.
*/
do_action( 'stormbringer_content_after' );
?>


</div>
<!-- /#content -->

Expand Down
15 changes: 14 additions & 1 deletion archive.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,12 @@

<div id="content" role="main">

<?php if ( function_exists( 'yoast_breadcrumb' ) ) : yoast_breadcrumb(); endif; ?>
<?php
/**
* stormbringer_content_after hook.
*/
do_action( 'stormbringer_content_after' );
?>

<header class="page-header archive-header">

Expand Down Expand Up @@ -76,6 +81,14 @@
}
?>
</footer>

<?php
/**
* stormbringer_content_after hook.
*/
do_action( 'stormbringer_content_after' );
?>

</div>
<!-- /#content -->

Expand Down
11 changes: 9 additions & 2 deletions inc/front/helpers.php
Original file line number Diff line number Diff line change
Expand Up @@ -53,5 +53,12 @@ function stormbringer_bootstrap_grid(&$counter_posts = 0, $args = array(), $elem
return $clearfix;
}



/**
* Display Yoast Breadcrumb
*
* @hooked stormbringer_content_before
*/
function stormbringer_breadcrumb(){
if ( function_exists( 'yoast_breadcrumb' ) ) : yoast_breadcrumb(); endif;
}
add_action('stormbringer_content_before', 'stormbringer_breadcrumb', 10);
Binary file modified page-fullwidth.php
Binary file not shown.
16 changes: 15 additions & 1 deletion page-fullwidthnotitle.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,14 @@

<div id="content" role="main">

<?php if ( function_exists( 'yoast_breadcrumb' ) ) : yoast_breadcrumb(); endif; ?>
<?php
/**
* stormbringer_content_before hook.
*
* @hooked stormbringer_breadcrumb - 10
*/
do_action( 'stormbringer_content_before' );
?>

<?php if ( have_posts() ) : the_post(); ?>

Expand All @@ -25,6 +32,13 @@

<?php endif; ?>

<?php
/**
* stormbringer_content_after hook.
*/
do_action( 'stormbringer_content_after' );
?>

</div>
<!-- /#content -->

Expand Down
16 changes: 15 additions & 1 deletion page-sitemap.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,14 @@

<div id="content" role="main">

<?php if ( function_exists( 'yoast_breadcrumb' ) ) : yoast_breadcrumb(); endif; ?>
<?php
/**
* stormbringer_content_before hook.
*
* @hooked stormbringer_breadcrumb - 10
*/
do_action( 'stormbringer_content_before' );
?>

<?php if ( have_posts() ) : the_post(); ?>

Expand Down Expand Up @@ -75,6 +82,13 @@
</section>
<!-- /.sitemap-content -->

<?php
/**
* stormbringer_content_after hook.
*/
do_action( 'stormbringer_content_after' );
?>

</div>
<!-- /#content -->

Expand Down
15 changes: 14 additions & 1 deletion page-styles.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,14 @@

<div id="content" role="main">

<?php if ( function_exists( 'yoast_breadcrumb' ) ) : yoast_breadcrumb(); endif; ?>
<?php
/**
* stormbringer_content_before hook.
*
* @hooked stormbringer_breadcrumb - 10
*/
do_action( 'stormbringer_content_before' );
?>

<?php if ( have_posts() ) : the_post(); ?>

Expand Down Expand Up @@ -7611,6 +7618,12 @@ classes (e.g.,
</div>
</div>

<?php
/**
* stormbringer_content_after hook.
*/
do_action( 'stormbringer_content_after' );
?>

</div>
<!-- /#content -->
Expand Down
16 changes: 15 additions & 1 deletion page-timeline.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,14 @@

<div id="content" role="main">

<?php if ( function_exists( 'yoast_breadcrumb' ) ) : yoast_breadcrumb(); endif; ?>
<?php
/**
* stormbringer_content_before hook.
*
* @hooked stormbringer_breadcrumb - 10
*/
do_action( 'stormbringer_content_before' );
?>

<?php if ( have_posts() ) : the_post(); ?>

Expand Down Expand Up @@ -97,6 +104,13 @@
</section>
<!-- /.timeline-content -->

<?php
/**
* stormbringer_content_after hook.
*/
do_action( 'stormbringer_content_after' );
?>

</div>
<!-- /#content -->

Expand Down
16 changes: 15 additions & 1 deletion page.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,14 @@

<div id="content" role="main">

<?php if ( function_exists( 'yoast_breadcrumb' ) ) : yoast_breadcrumb(); endif; ?>
<?php
/**
* stormbringer_content_before hook.
*
* @hooked stormbringer_breadcrumb - 10
*/
do_action( 'stormbringer_content_before' );
?>

<?php if ( have_posts() ) : the_post(); ?>

Expand All @@ -31,6 +38,13 @@

<?php endif; ?>

<?php
/**
* stormbringer_content_after hook.
*/
do_action( 'stormbringer_content_after' );
?>

</div>
<!-- /#content -->

Expand Down
16 changes: 15 additions & 1 deletion search.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,14 @@

<div id="content" role="main">

<?php if ( function_exists('yoast_breadcrumb') ) : yoast_breadcrumb(); endif; ?>
<?php
/**
* stormbringer_content_before hook.
*
* @hooked stormbringer_breadcrumb - 10
*/
do_action( 'stormbringer_content_before' );
?>

<header class="page-header search-header">
<h1 class="page-title search-title">
Expand Down Expand Up @@ -39,6 +46,13 @@

<?php endif; ?>

<?php
/**
* stormbringer_content_after hook.
*/
do_action( 'stormbringer_content_after' );
?>

</div>
<!-- /#content -->

Expand Down
16 changes: 15 additions & 1 deletion single.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,14 @@

<div id="content" role="main">

<?php if ( function_exists( 'yoast_breadcrumb' ) ) : yoast_breadcrumb(); endif; ?>
<?php
/**
* stormbringer_content_before hook.
*
* @hooked stormbringer_breadcrumb - 10
*/
do_action( 'stormbringer_content_before' );
?>

<?php if ( have_posts() ) : the_post(); ?>

Expand All @@ -32,6 +39,13 @@

<?php endif; ?>

<?php
/**
* stormbringer_content_after hook.
*/
do_action( 'stormbringer_content_after' );
?>

</div>
<!-- /#content -->

Expand Down
16 changes: 15 additions & 1 deletion woocommerce.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,24 @@

<div id="content" role="main">

<?php if (function_exists('yoast_breadcrumb')) : yoast_breadcrumb(); endif; ?>
<?php
/**
* stormbringer_content_before hook.
*
* @hooked stormbringer_breadcrumb - 10
*/
do_action( 'stormbringer_content_before' );
?>

<?php woocommerce_content(); ?>

<?php
/**
* stormbringer_content_after hook.
*/
do_action( 'stormbringer_content_after' );
?>

</div>
<!-- /#content -->

Expand Down

0 comments on commit 6a0dfbb

Please sign in to comment.