Skip to content
Open
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
102 changes: 73 additions & 29 deletions footer.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,40 +10,84 @@
*/

?>
</div><!-- .tg-container -->
</div><!-- #content -->

<?php
// Show related post if enabled.
if ( true === get_theme_mod( 'cenote_single_enable_related_post', true ) && is_single() ) {
get_template_part( 'template-parts/related/related', 'post' );
}
/**
* Hook - cenote_after_content
*
* Functions hooked into cenote_after_content action
*
* @hooked cenote_content_end
*/
do_action( 'cenote_after_content' );
?>
<footer id="colophon" class="site-footer tg-site-footer <?php cenote_footer_class(); ?>">
<div class="tg-footer-top">
<div class="tg-container">
<?php get_sidebar( 'footer' ); ?>
</div>
</div><!-- .tg-footer-top -->

<div class="tg-footer-bottom">
<div class="tg-container">
<div class="tg-footer-bottom-container tg-flex-container">
<div class="tg-footer-bottom-left">
<?php get_template_part( 'template-parts/footer/footer', 'info' ); ?>
</div><!-- .tg-footer-bottom-left -->
<div class="tg-footer-bottom-right">
</div><!-- .tg-footer-bottom-right-->
</div><!-- .tg-footer-bootom-container-->
</div>
</div><!-- .tg-footer-bottom -->
</footer><!-- #colophon -->

</div><!-- #page -->

<?php
// Show related post if enabled.
if ( true === get_theme_mod( 'cenote_single_enable_related_post', true ) && is_single() ) {
get_template_part( 'template-parts/related/related', 'post' );
}
?>

<?php
/**
* Hook - cenote_before_footer
*
* Functions hooked into cenote_before_footer action
*
* @hooked cenote_footer_start
*/
do_action( 'cenote_before_footer' );
?>

<?php
/**
* Hook - cenote_footer_top
*
* Functions hooked into cenote_footer_top action
*
* @hooked cenote_footer_top
*/
do_action( 'cenote_footer_top' );
?>

<?php
/**
* Hook - cenote_footer_bottom
*
* Functions hooked into cenote_footer_bottom action
*
* @hooked cenote_footer_bottom
*/
do_action( 'cenote_footer_bottom' );
?>

<?php
/**
* Hook - cenote_after_footer
*
* Functions hooked into cenote_after_footer action
*
* @hooked cenote_footer_end
* @hooked cenote_add_footer_extras
*/
do_action( 'cenote_after_footer' );
?>

<?php
do_action( 'cenote_after_footer' );
wp_footer();
/**
* Hook - cenote_after
*
* Functions hooked into cenote_after action
*
* @hooked cenote_page_end
* @hooked cenote_add_footer_extras

*/
do_action( 'cenote_after' );
?>

<?php wp_footer(); ?>

</body>
</html>
8 changes: 8 additions & 0 deletions functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -275,6 +275,14 @@ function cenote_scripts() {
*/
require get_template_directory() . '/inc/customizer.php';

/**
* Load Hooks.
*/
require get_template_directory() . '/inc/hooks/hooks.php';
require get_template_directory() . '/inc/hooks/header.php';
require get_template_directory() . '/inc/hooks/content.php';
require get_template_directory() . '/inc/hooks/footer.php';

/**
* Meta boxes.
*/
Expand Down
91 changes: 70 additions & 21 deletions header.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,19 @@
<!doctype html>
<html <?php language_attributes(); ?>>
<head>
<meta charset="<?php bloginfo( 'charset' ); ?>">
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no">
<link rel="profile" href="http://gmpg.org/xfn/11">

<?php wp_head(); ?>
<?php
/**
* Hook - cenote_head
*
* Functions hooked into cenote_head action
*
* @hooked cenote_head - 10
*/
do_action( 'cenote_head' );
?>

<?php wp_head(); ?>
</head>

<body <?php body_class(); ?>>
Expand All @@ -28,26 +36,67 @@
}
?>

<div id="page" class="site">
<a class="skip-link screen-reader-text" href="#content"><?php esc_html_e( 'Skip to content', 'cenote' ); ?></a>
<?php
/**
* Hook - cenote_before_header
*
* Functions hooked into cenote_before_header action
*
* @hooked cenote_page_start - 10
* @hooked cenote_header_start - 15
*/
do_action( 'cenote_before_header' );


if ( true === get_theme_mod( 'cenote_enable_header_top', true ) ) :

<header id="masthead" class="site-header tg-site-header <?php cenote_header_class(); ?>">
<?php if ( true === get_theme_mod( 'cenote_enable_header_top', true ) ) : ?>
<div class="tg-header-top">
<div class="tg-container tg-flex-container tg-flex-space-between tg-flex-item-centered">
<?php get_template_part( 'template-parts/header/header', 'top' ); ?>
</div>
</div><!-- .tg-header-top -->
<?php endif; ?>
/**
* Hook - cenote_header_top
*
* Functions hooked into cenote_header_top action
*
* @hooked cenote_header_top - 10
*/
do_action( 'cenote_header_top' );

<div class="tg-header-bottom">
<?php get_template_part( 'template-parts/header/header', 'bottom' ); ?>
</div>
endif;
?>

<?php
/**
* Hook - cenote_header_bottom
*
* Functions hooked into cenote_header_bottom action
*
* @hooked cenote_header_bottom - 10
*/
do_action( 'cenote_header_bottom' );
?>

<?php
/**
* Hook - cenote_header_end
*
* Functions hooked into cenote_header_end action
*
* @hooked cenote_header_end - 10
*/
do_action( 'cenote_header_end' );
?>

<?php do_action( 'cenote_after_header' ); ?>

<?php
/**
* Hook - cenote_before_content
*
* Functions hooked into cenote_before_content action
*
* @hooked cenote_content_start - 10
*/
do_action( 'cenote_before_content' );
?>

</header><!-- #masthead -->

<?php do_action( 'cenote_after_header' ); ?>

<div id="content" class="site-content">

<div class="tg-container tg-flex-container tg-flex-space-between">
30 changes: 30 additions & 0 deletions inc/hooks/content.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
<?php
/**
* Cenote content functions to be hooked
*
* @package cenote
*/

if ( ! function_exists( 'cenote_read_more' ) ) :
/**
* Post Read More.
*/
function cenote_read_more() {
?>
<footer class="entry-footer">
<a href="<?php the_permalink(); ?>" class="tg-readmore-link"><?php esc_html_e( 'Read More', 'cenote' ); ?></a>
</footer><!-- .entry-footer -->
<?php
}
endif;

if ( ! function_exists( 'cenote_pagination' ) ) :
/**
* Pagination.
*/
function cenote_pagination() {

get_template_part( 'template-parts/pagination/pagination' );

}
endif;
122 changes: 122 additions & 0 deletions inc/hooks/footer.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,122 @@
<?php
/**
* Cenote footer functions to be hooked
*
* @package cenote
*/

if ( ! function_exists( 'cenote_content_end' ) ) :
/**
* Content end.
*/
function cenote_content_end() {
?>
</div><!-- .tg-container -->
</div><!-- #content -->
<?php
}
endif;

if ( ! function_exists( 'cenote_footer_start' ) ) :
/**
* Footer start.
*/
function cenote_footer_start() {
?>
<footer id="colophon" class="site-footer tg-site-footer <?php cenote_footer_class(); ?>">
<?php
}
endif;

if ( ! function_exists( 'cenote_footer_top' ) ) :
/**
* Footer Top.
*/
function cenote_footer_top() {
?>
<div class="tg-footer-top">
<div class="tg-container">
<?php get_sidebar( 'footer' ); ?>
</div>
</div><!-- .tg-footer-top -->
<?php
}
endif;

if ( ! function_exists( 'cenote_footer_bottom' ) ) :
/**
* Footer bottom.
*/
function cenote_footer_bottom() {
?>
<div class="tg-footer-bottom">
<div class="tg-container">
<div class="tg-footer-bottom-container tg-flex-container">
<div class="tg-footer-bottom-left">

<?php
/**
* Hook - cenote_footer_bottom_one
*
* Functions hooked into cenote_footer_bottom_one action
*
* @hooked cenote_footer_bottom_one
*/
do_action( 'cenote_footer_bottom_one' );
?>

</div><!-- .tg-footer-bottom-left -->

<div class="tg-footer-bottom-right">

<?php
/**
* Hook - cenote_footer_bottom_two
*
* Functions hooked into cenote_footer_bottom_two action
*
* @hooked cenote_footer_bottom_two
*/
do_action( 'cenote_footer_bottom_two' );
?>
</div><!-- .tg-footer-bottom-right-->
</div><!-- .tg-footer-bootom-container-->
</div>
</div><!-- .tg-footer-bottom -->
<?php
}
endif;

if ( ! function_exists( 'cenote_footer_bottom_one' ) ) :
/**
* Footer end.
*/
function cenote_footer_bottom_one() {

get_template_part( 'template-parts/footer/footer', 'info' );
}
endif;

if ( ! function_exists( 'cenote_footer_end' ) ) :
/**
* Footer end.
*/
function cenote_footer_end() {
?>
</footer><!-- #colophon -->

<?php
}
endif;

if ( ! function_exists( 'cenote_page_end' ) ) :
/**
* Page end.
*/
function cenote_page_end() {
?>
</div><!-- #page -->

<?php
}
endif;
Loading