I uploaded a custom page (html,css, and a few scripts) through the file manager, and want the customer to have access to this page through the admin "Pages" menu in the admin area.
The page is accessible through
www.site/{my_page}
but admin area doesn't recognize it under Pages.
How should I put it under Pages section of admin area?
I uploaded a custom page (html,css, and a few scripts) through the file manager, and want the customer to have access to this page through the admin "Pages" menu in the admin area.
The page is accessible through
www.site/{my_page}
but admin area doesn't recognize it under Pages.
How should I put it under Pages section of admin area?
Share Improve this question edited Mar 23, 2020 at 10:23 WordPress Speed 2,2833 gold badges19 silver badges34 bronze badges asked Mar 21, 2020 at 7:13 Daniil KiselevDaniil Kiselev 11 bronze badge 1- Was my answer helpful? Please accept and upvote if it was helpful to you – WordPress Speed Commented Mar 28, 2020 at 16:03
1 Answer
Reset to default 0First, remove your newly uploaded page through ftp.
1. Static content
If your have static content:
- Go to Admin area and go to Pages section and add a new page. You may change the slug to
my_page
or any thing else (it should be an available slug and not already assigned to any other post or page) - Put your content inside the Editor section and use TinyMCE to make it look as your want. You may use h1-h6, Bold, Italic, put images and videos and more.
2. Dynamic content
If your have dynamic content needs:
2.1. You own the current theme
If you own the theme you may add your file to your theme:
Create a file named
page-{slug}.php
under your theme's root directory where{slug}
is your page slug (maybemy_page
which will bepage-my_page.php
) and you may access it like:www.site/my_page
put some inclusions to include common parts like header & footer into it:
<?php get_header(); ?> <main> <?php if ( have_posts() ) : ?> while ( have_posts() ) : the_post(); ?> <h1><?php the_title(); ?></h1> <div><?php the_content(); ?></div> <?php endwhile; endif; ?> </main> <?php get_footer(); ?>
2.2. You use a default wordpress (2020 theme) or any 3rd party theme
If you do not own the theme, then you may consider creating a child theme and go to step 2.1 afterwards.