0
votes

I am developing a custom theme in WordPress, and am trying to put custom HTML and PHP in my home page template. Whenever I am posting code for divs or custom fields in my home page template, they are simply not rendering and displaying on the front end. In the example below, the <div class="col-full"> is not being shown on the front end.

    <?php 
    /*
    Template Name: home
    */
    ?>
    <!DOCTYPE html>

    <?php get_header(); ?>

    <center>
        <div class="col-full">
    <?php get_template_part( 'content', get_post_format() ); ?>


    </center>

    <?php get_footer(); ?>
1

1 Answers

0
votes

Looking at your code, you've set it up as a template file. These need to be manually selected from the page as the template for it to work.

I'd recommend consulting the wordpress template hierarchy https://wphierarchy.com/. This shows you which files will try to be loaded based on what page you're visiting.

If you're still having trouble, i'd suggest installing the plugin https://en-au.wordpress.org/plugins/query-monitor/, which will tell you the template being loaded as well as other handy information.