0

I am currently working on a project that uses a child theme (storefront is the parent theme). I need to be able to code using pure php / javascript (outside wordpress admin). Other custom template pages have *-content.php structure, such as: foo-content.php.

I created the custom page I'd like to develop on. However, when visiting the url, I am getting a blank white page. I am having a hard time understanding why this is.

Additionally, I tried going to wordpress admin and creating the page in the admin so it matches the file name I created my.domain.com/foo, nothing seems to work - I keep getting a blank white page and no errors. Any ideas why this is?

I appreciate any suggestions.

1
  • 1
    If you are getting a white screen, that is probably because of a fatal error in the code. So looking at the error.log file (and sharing it if needed ; add to your question) will help you (and others here). And take a look at the Template section of the codex on how the get_template_part() function works to understand how to call a template 'part'. – Rick Hellewell Jan 31 '19 at 18:59
0

When you create a template page, it does not create a WordPress URL for it. So for example, if you create a PHP file called contact-content.php it doesn't generate example.com/contact/.

If you don't want to manually create a page and assign a Page Template to it (which by the way would normally be named something like tpl-content.php - the PHP comments are what designate it to be a Page Template you can select in the editor), you can add code in your child theme so that upon activation, it automatically creates a Page with whatever slug you want. If it's just your site, you'll know your permalink structure so you can be sure the URL will be what you wish. If it's something you're applying to many sites with different settings, you may still face the issue of different styles of permalinks - i.e. example.com?p=123 versus example.com/contact/.

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.