I created a custom theme for WordPress, and the folder only has the header, footer, index (which calls for the header and footer) and page PHP files until now.
What I'm trying to do is to show another WordPress page of my own site (that one we create at /wp-admin/post-new.php?post_type=page
) which has an URL.
The codes I tried to use are below.
I was redirected to the page I wanted (http://localhost/wordpress/test-page/
) on the browser correctly, but the page doesn't show the text I wrote at my WordPress page. Am I missing something?
index.php:
<?php get_header(); ?>
<a href="http://localhost/wordpress/test-page/">This is the WordPress Page URL</a></br>
<?php get_footer(); ?>
page.php:
<?php get_header(); ?>
<!-- Some code to show the WordPress Page -->
<?php get_footer(); ?>
I expect to show the WordPress page contents, using the header and footer styles I created.
EDIT: Just uploaded new images to illustrate what I meant. These are using WordPress standard theme. I'm trying to show that "test" page in my custom theme. But when I access that page by the URL, it doesn't show the "Test page" contents.
page-whatever.php
route, the page you create needs to literally be called "Whatever". Look into template hierarchy. developer.wordpress.org/files/2014/10/… What you may consider is in your theme create apage.php
and add your custom header and footer stuff there. That way, all pages share that template. – disinfor