Hi, i have a custom PHP codes running in 3 static pages. I have created the pages using the wordpress back-office, and writing the title and using the default template.
For example, the ID of one of them is 100, with slug “contacto”.
I folowed the Template hierarchy and re-named a copy of “/Newspaper/page.php” file in my theme child.
Single Page #
custom template file – The page template assigned to the page. See get_page_templates(). page-{slug}.php – If the page slug is recent-news, WordPress will look to use page-recent-news.php page-{id}.php – If the page ID is 6, WordPress will look to use page-6.php. page.php singular.php index.php
In my case i chosse using this name: page-archive.php (but i tested with page-100.php too)
I am running this in mi localhost and in other hosting for testing purposes, and are working great.
Working in a new server:
The strange thing is that now, i have imported 160.000 news , and for an unknown reason this hierarchy don’t work any more. Now is working in localhost.. “the same files”!! but in the real production server this is not working.
Then i created all these files with empty content. Only with the line <?php echo ‘page-slug.php’;?>.
And they never load!.
Why is this happening?.
Hello,
If you wish to create new templates using our theme, you will have to use the theme API system: https://forum.tagdiv.com/td_api_single_templateadd/
Please be advised as this is for advanced users and it represents theme customization (not covered by support). You will need a bit of coding know-how to do it.
I hope this helps.
Thank you!
Hi,
Please follow this topic to see how you can add a new template: https://forum.tagdiv.com/api-single-template-introduction/
The theme API is for advanced users only and is not covered by the theme support as it represents customization. There is no step by step tutorial on how to do this as it requires coding knowledge and adaptation of the code to your own custom template. If you do not have the proper knowledge we recommend hiring a freelancer from sites like studio.envato.com
Thank you!
