Skip to content

Commit 6a0dfbb

Browse files
committed
* **New** - Hooks before content and after content
* **Tweak** - Yoast breadcrumb now hooked to before content hook
1 parent e390211 commit 6a0dfbb

12 files changed

+158
-12
lines changed

404.php

+16-1
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,27 @@
1212

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

15-
<?php if ( function_exists( 'yoast_breadcrumb' ) ) : yoast_breadcrumb(); endif; ?>
15+
<?php
16+
/**
17+
* stormbringer_content_before hook.
18+
*
19+
* @hooked stormbringer_breadcrumb - 10
20+
*/
21+
do_action( 'stormbringer_content_before' );
22+
?>
1623

1724
<?php
1825
get_template_part( 'content', 'none' );
1926
?>
2027

28+
<?php
29+
/**
30+
* stormbringer_content_after hook.
31+
*/
32+
do_action( 'stormbringer_content_after' );
33+
?>
34+
35+
2136
</div>
2237
<!-- /#content -->
2338

archive.php

+14-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,12 @@
1010

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

13-
<?php if ( function_exists( 'yoast_breadcrumb' ) ) : yoast_breadcrumb(); endif; ?>
13+
<?php
14+
/**
15+
* stormbringer_content_after hook.
16+
*/
17+
do_action( 'stormbringer_content_after' );
18+
?>
1419

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

@@ -76,6 +81,14 @@
7681
}
7782
?>
7883
</footer>
84+
85+
<?php
86+
/**
87+
* stormbringer_content_after hook.
88+
*/
89+
do_action( 'stormbringer_content_after' );
90+
?>
91+
7992
</div>
8093
<!-- /#content -->
8194

inc/front/helpers.php

+9-2
Original file line numberDiff line numberDiff line change
@@ -53,5 +53,12 @@ function stormbringer_bootstrap_grid(&$counter_posts = 0, $args = array(), $elem
5353
return $clearfix;
5454
}
5555

56-
57-
56+
/**
57+
* Display Yoast Breadcrumb
58+
*
59+
* @hooked stormbringer_content_before
60+
*/
61+
function stormbringer_breadcrumb(){
62+
if ( function_exists( 'yoast_breadcrumb' ) ) : yoast_breadcrumb(); endif;
63+
}
64+
add_action('stormbringer_content_before', 'stormbringer_breadcrumb', 10);

page-fullwidth.php

195 Bytes
Binary file not shown.

page-fullwidthnotitle.php

+15-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,14 @@
1515

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

18-
<?php if ( function_exists( 'yoast_breadcrumb' ) ) : yoast_breadcrumb(); endif; ?>
18+
<?php
19+
/**
20+
* stormbringer_content_before hook.
21+
*
22+
* @hooked stormbringer_breadcrumb - 10
23+
*/
24+
do_action( 'stormbringer_content_before' );
25+
?>
1926

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

@@ -25,6 +32,13 @@
2532

2633
<?php endif; ?>
2734

35+
<?php
36+
/**
37+
* stormbringer_content_after hook.
38+
*/
39+
do_action( 'stormbringer_content_after' );
40+
?>
41+
2842
</div>
2943
<!-- /#content -->
3044

page-sitemap.php

+15-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,14 @@
1414

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

17-
<?php if ( function_exists( 'yoast_breadcrumb' ) ) : yoast_breadcrumb(); endif; ?>
17+
<?php
18+
/**
19+
* stormbringer_content_before hook.
20+
*
21+
* @hooked stormbringer_breadcrumb - 10
22+
*/
23+
do_action( 'stormbringer_content_before' );
24+
?>
1825

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

@@ -75,6 +82,13 @@
7582
</section>
7683
<!-- /.sitemap-content -->
7784

85+
<?php
86+
/**
87+
* stormbringer_content_after hook.
88+
*/
89+
do_action( 'stormbringer_content_after' );
90+
?>
91+
7892
</div>
7993
<!-- /#content -->
8094

page-styles.php

+14-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,14 @@
1414

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

17-
<?php if ( function_exists( 'yoast_breadcrumb' ) ) : yoast_breadcrumb(); endif; ?>
17+
<?php
18+
/**
19+
* stormbringer_content_before hook.
20+
*
21+
* @hooked stormbringer_breadcrumb - 10
22+
*/
23+
do_action( 'stormbringer_content_before' );
24+
?>
1825

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

@@ -7611,6 +7618,12 @@ classes (e.g.,
76117618
</div>
76127619
</div>
76137620

7621+
<?php
7622+
/**
7623+
* stormbringer_content_after hook.
7624+
*/
7625+
do_action( 'stormbringer_content_after' );
7626+
?>
76147627

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

page-timeline.php

+15-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,14 @@
1414

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

17-
<?php if ( function_exists( 'yoast_breadcrumb' ) ) : yoast_breadcrumb(); endif; ?>
17+
<?php
18+
/**
19+
* stormbringer_content_before hook.
20+
*
21+
* @hooked stormbringer_breadcrumb - 10
22+
*/
23+
do_action( 'stormbringer_content_before' );
24+
?>
1825

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

@@ -97,6 +104,13 @@
97104
</section>
98105
<!-- /.timeline-content -->
99106

107+
<?php
108+
/**
109+
* stormbringer_content_after hook.
110+
*/
111+
do_action( 'stormbringer_content_after' );
112+
?>
113+
100114
</div>
101115
<!-- /#content -->
102116

page.php

+15-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,14 @@
1414

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

17-
<?php if ( function_exists( 'yoast_breadcrumb' ) ) : yoast_breadcrumb(); endif; ?>
17+
<?php
18+
/**
19+
* stormbringer_content_before hook.
20+
*
21+
* @hooked stormbringer_breadcrumb - 10
22+
*/
23+
do_action( 'stormbringer_content_before' );
24+
?>
1825

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

@@ -31,6 +38,13 @@
3138

3239
<?php endif; ?>
3340

41+
<?php
42+
/**
43+
* stormbringer_content_after hook.
44+
*/
45+
do_action( 'stormbringer_content_after' );
46+
?>
47+
3448
</div>
3549
<!-- /#content -->
3650

search.php

+15-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,14 @@
1010

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

13-
<?php if ( function_exists('yoast_breadcrumb') ) : yoast_breadcrumb(); endif; ?>
13+
<?php
14+
/**
15+
* stormbringer_content_before hook.
16+
*
17+
* @hooked stormbringer_breadcrumb - 10
18+
*/
19+
do_action( 'stormbringer_content_before' );
20+
?>
1421

1522
<header class="page-header search-header">
1623
<h1 class="page-title search-title">
@@ -39,6 +46,13 @@
3946

4047
<?php endif; ?>
4148

49+
<?php
50+
/**
51+
* stormbringer_content_after hook.
52+
*/
53+
do_action( 'stormbringer_content_after' );
54+
?>
55+
4256
</div>
4357
<!-- /#content -->
4458

single.php

+15-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,14 @@
1010

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

13-
<?php if ( function_exists( 'yoast_breadcrumb' ) ) : yoast_breadcrumb(); endif; ?>
13+
<?php
14+
/**
15+
* stormbringer_content_before hook.
16+
*
17+
* @hooked stormbringer_breadcrumb - 10
18+
*/
19+
do_action( 'stormbringer_content_before' );
20+
?>
1421

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

@@ -32,6 +39,13 @@
3239

3340
<?php endif; ?>
3441

42+
<?php
43+
/**
44+
* stormbringer_content_after hook.
45+
*/
46+
do_action( 'stormbringer_content_after' );
47+
?>
48+
3549
</div>
3650
<!-- /#content -->
3751

woocommerce.php

+15-1
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,24 @@
1212

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

15-
<?php if (function_exists('yoast_breadcrumb')) : yoast_breadcrumb(); endif; ?>
15+
<?php
16+
/**
17+
* stormbringer_content_before hook.
18+
*
19+
* @hooked stormbringer_breadcrumb - 10
20+
*/
21+
do_action( 'stormbringer_content_before' );
22+
?>
1623

1724
<?php woocommerce_content(); ?>
1825

26+
<?php
27+
/**
28+
* stormbringer_content_after hook.
29+
*/
30+
do_action( 'stormbringer_content_after' );
31+
?>
32+
1933
</div>
2034
<!-- /#content -->
2135

0 commit comments

Comments
 (0)