Back to Blog

How to use Astra WordPress Theme - Astra Theme Tutorial

Learn to use Astra theme with this programatic walkthough guide.

Jan 8, 2023 Updated: Jan 8, 2023

Page Template

The code for custom page template is taken from page.php file. You can copy the below code or copy the code from page.php file in Astra theme.

tpl-home.php
<?php
/**
 * Template Name: Home Page
 */

get_header();

if ( astra_page_layout() == 'left-sidebar' ){
    get_sidebar();
}
?>
<div id="primary" <?php astra_primary_class(); ?>>

    <?php astra_primary_content_top(); ?>
    <?php astra_content_page_loop(); ?>
    <?php astra_primary_content_bottom(); ?>

</div><!-- #primary -->
<?php
if ( astra_page_layout() == 'right-sidebar' ){
    get_sidebar();
}
get_footer();
Contact

Got A Question For Me?

Feel free to ask anything directly on call or fill the form and I will contact back within few hours.