I’ve created my own WordPress theme with a custom guestbook post type. I’ve also enabled WordPress multi-site to create multiple sites with the same theme and templates.

After creating a new page on a newly created site and selecting the guestbook page template, the page shows as an archive page and not the page template I selected. The page on the original main site works perfectly.

I’ve had a quick google and there’s a few different issues that don’t directly relate to mine. Does anyone know what I’m doing wrong please?

My guestbook page template is below.

<?php 
/**
 * Template Name: Guestbook
 *
 * @link https://codex.wordpress.org/Template_Hierarchy
 *
 * @package Doralwoods
 */

get_header(); ?>

	<div id="primary" class="content-area">
		<main id="main" class="site-main" role="main">

			<h1 class="entry-title"><?php single_post_title(); ?></h1>

			<?php if(have_posts()): while(have_posts()): the_post();
				the_content();
			endwhile; endif; 

			$loop = new WP_Query( array( 'post_type' => 'guestbook_entry', 'posts_per_page' => 100 )); 
			while ( $loop->have_posts() ) : $loop->the_post(); ?>
			     
		        <div class="guestbook__entry">
					<?php the_title( '<h2>', '</h2>' ); ?>
					<?php the_content(); ?>
					<div class="guestbook__meta"><?php the_meta(); ?></div>
				</div>
			     
			<?php endwhile;
			wp_reset_query();

			?>

		</main><!-- #main -->
	</div><!-- #primary -->

<?php
get_sidebar();
get_footer();

Read more here: Custom post type page template not working on WordPress multi-site


Solution:

If you know the solution of this issue, please leave us a reply in Comment section, to update the question.


Wordpress related questions and answers: