Custom Page Template
-
I’m trying to figure out how to make a custom page template work with Customizr as I need custom PHP/SQL and custom fields for my site content.
Actions/hooks are new to me but I’ve done a tonne of reading and research as well as some experiments that just don’t work. I don’t get any errors but my functions do not show up. I’ve even done the “Gill” test code Customizr provides on this page (https://docs.presscustomizr.com/article/26-wordpress-actions-filters-and-hooks-a-guide-for-non-developers) and nothing shows up! What am I missing?
Anyway, I can’t find basic instructions on how to do this anywhere but something is flying right over my head in regard to this theme. ?? Can anyone point me in the right direction?
I’d provide a link but I am only working locally right now. I’ve created a child theme and a template/plugin. Where do I start? How do I edit this from the backend?
<?php
/*
Template Name: Test Template
*/
if ( apply_filters( ‘czr_ms’, false ) ) {
do_action( ‘czr_ms_tmpl’ );
return;
}
?><?php do_action( ‘__before_main_wrapper’ ); ##hook of the header with get_header ?>
<div id=”main-wrapper” class=”<?php echo implode(‘ ‘, apply_filters( ‘tc_main_wrapper_classes’ , array(‘container’) ) ) ?>”><?php do_action( ‘__before_main_container’ ); ##hook of the featured page (priority 10) and breadcrumb (priority 20)…and whatever you need! ?>
<div class=”container” role=”main”>
<div class=”<?php echo implode(‘ ‘, apply_filters( ‘tc_column_content_wrapper_classes’ , array(‘row’ ,’column-content-wrapper’) ) ) ?>”>
<?php do_action( ‘__before_article_container’ ); ##hook of left sidebar?>
<div id=”content” class=”<?php echo implode(‘ ‘, apply_filters( ‘tc_article_container_class’ , array( CZR_utils::czr_fn_get_layout( czr_fn_get_id() , ‘class’ ) , ‘article-container’ ) ) ) ?>”>
<?php do_action( ‘__before_loop’ );##hooks the header of the list of post : archive, search… ?>
<?php if ( have_posts() ) : ?>
<?php while ( have_posts() ) : ##all other cases for single and lists: post, custom post type, page, archives, search, 404 ?>
<?php the_post(); ?>
<?php do_action( ‘__before_article’ ) ?>
<article <?php czr_fn__f( ‘__article_selectors’ ) ?>>
<?php do_action( ‘__loop’ ); ?>
</article><?php do_action( ‘__after_article’ ) ?>
<?php endwhile; ?>
<?php endif; ##end if have posts ?>
<?php do_action( ‘__after_loop’ );##hook of the comments and the posts navigation with priorities 10 and 20 ?>
</div><!–.article-container –><?php do_action( ‘__after_article_container’ ); ##hook of left sidebar ?>
</div><!–.row –>
</div><!– .container role: main –>
<?php do_action( ‘__after_main_container’ ); ?>
</div><!– //#main-wrapper –>
<?php do_action( ‘__after_main_wrapper’ );##hook of the footer with get_get_footer ?>
- The topic ‘Custom Page Template’ is closed to new replies.