skip to Main Content

I want to make amp based static page like html but whenever i put that in wordpress,
wordpress applies its theme styles and settings

I want that it should not be affected by wordpress atleast not any theme based css or javascript

Thank you all

there must be a better way to do this please help
Thanks again

2

Answers


  1. You are looking for Page templates.

    Page templates are a specific type of template file that can be applied to a specific page or groups of pages.

    You can refer to @ https://developer.wordpress.org/themes/template-files-section/page-template-files/

    In short, you can create a new page template page-{slug}.php (save at root). We then need to tell WordPress that this new file is a "template". We can do so through a comment header (bellow is a minimal version of it). You would probably need to include the theme header and footer too.

    <?php
    
    /*
     * Template Name: My new template title
    */
    
    get_header();
    
    // Page code here...
    
    get_footer();
    
    Login or Signup to reply.
  2. You could create a dedicated PHP template file for that page, which you only assign to that particular page, and which does not contain the get_header() function.

    Since besides not calling the theme stylesheet/s, this will also exclude a lot of other (necessary) functions, you could create a copy of your header.php file (in a child theme, if the theme isn’t yours) which contains all the necessary functions and links except the link to the theme stylesheet, and call that "alternative header" file in your template for that page instead of using get_header().

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search