Can’t figure out how to display current page content

[ad_1]

Hi there, I’m busy developing a website with my own theme for the first time and ACF. I managed to display a header and footer through the homepage, but cannot figure out how to display the ‘Home’ page content itself.

I have an index.php file that calls the header and footer on each page, and I tried to also call get\_the\_content or get\_content there, but it doesn’t show anything under the .main-content div, not even an error. I set the home/landing page to show the ‘Home’ page in the WP settings so that doesn’t seem to be the issue. I have a home.php file with the ACF content that I only want to show when ‘Home’ is active

It seems to me that WordPress doesn’t know home.php exists or to get that content when the ‘Home’ page is active but can’t find anywhere how to call it. I’ve always worked with an existing development theme that did all the php layout for me, hence why I’m extremely new to this.

The index.php file:

<?php get\_header(); ?>

<div id=”main”>
<div class=”main-content”>
<?= get\_the\_content();?>
</div>
</div>
<?php get\_footer(); ?>

(the backslashes aren’t in the actual code, Reddit formatting is being weird)

The home.php is just ACF content with a html layout, tested it with just a h1 tag as well, but no luck

[ad_2]

 

This site will teach you how to build a WordPress website for beginners. We will cover everything from installing WordPress to adding pages, posts, and images to your site. You will learn how to customize your site with themes and plugins, as well as how to market your site online.

Buy WordPress Transfer