最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

static website - How to list newly ftp added HTML webpage under Pages section of wp-admin?

programmeradmin2浏览0评论

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
Add a comment  | 

1 Answer 1

Reset to default 0

First, remove your newly uploaded page through ftp.

1. Static content

If your have static content:

  1. 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)
  2. 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:

  1. Create a file named page-{slug}.php under your theme's root directory where {slug} is your page slug (maybe my_page which will be page-my_page.php) and you may access it like:

    www.site/my_page
    
  2. 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.

发布评论

评论列表(0)

  1. 暂无评论