1

I have a folder containing an index page, assets, JS etc. that I want to add as it's own page to my wordpress site without just linking to where it's hosted on a webserver. I have copied this folder into my wp-content directory but am not sure how to now add it to the site itself, can anyone help me with this or suggest an alternate way of achieving the same?

  • If you want to use all the functionalites of WordPress, you have to follow the WordPress philosophy. The first thing that you can try is going in the backend (/wp-admin/) and create a new page. – mmm Oct 27 '17 at 13:06
  • Yes I can do that, but what I want to do is add a page via the wp-admin dashboard, but have that page just be the one I already have in my content folder, is that possible? – Madden Oct 27 '17 at 13:15
  • Not exactly. In order to include things like your header with navigation, your sitewide footer, and your sitewide styles, you need to: add the content as a page, set up a child theme, and then create a page template if you want the content to display differently or if you have added functionality like your JS/assets. Just uploading a straight page means your content is completely separate and cut off from WordPress, and you can't add links to it from menus, etc. It also means if your site navigation/footer/etc. change those changes won't copy over to your static page. – WebElaine Oct 27 '17 at 16:13
1

The best option for you likely is to create a page template. This will allow you to put your code in a php file (the template) and add footer and header information to that page. You then assign this file to a page within wordpress. That ties your new code into wordpress. You still have access to the page in your actual server directories (wp-admin/wp-content/themes/child-theme/template-rtcustom.php for example).

You'll be able to tie in all your assets as normal if you're used to coding. It's definitely not as simple as drop and go, but it is a relatively simple process depending on your theme.

This is not a guide I wrote, but it will give you more of an idea of what you're getting into: https://premium.wpmudev.org/blog/creating-custom-page-templates-in-wordpress/

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.