I need guides please, as I am new to this.
So I installed WordPress locally and managed to create my custom theme with just the basic theme content.
Theme Directory: wp-content/themes/custom-theme/
In this directory I wish to create sub-directories (content/home
, content/blog
...), and then I want my pages to read from this sub-directories, ect.
The homepage will read from custom-theme\content\home
with the home directory folder including files like page.php
.
I did already manage to create a template file called page-home.php
which I linked as a template Parent page to the new page I created in wordpress. My problem is the files in that directory do not get hooked.
Code from page-home.php
<?php
/*Template Name: Home - Parent Page */
?>
<?php get_header(); ?>
<div id="content-main">
<?php $contentSrc = "content/home"; ?>
<script>
window.contentSrc = '<?php echo $contentSrc; ?>';
</script>
<?php //get_template_part("page-home"); ?>
</div>
<?php get_footer(); ?>
This is something I've tried. And it then should hook the pages from sub directory content/home .
Code from: content/home/page.php
<div id="home">
<div class="hook" data-hook="home-info"></div>
<div class="hook" data-hook="home-navi"></div>
</div>
This needs a function/js to work, but its just the idea of what I need and what I want to make happen.
Any links to guidelines for this or tips would be much appreciated, I have looked everywhere and i just do not find any easy or exact topic based on my question.
Maybe there is just a very easy way of doing it, i am interested.