Title: Using a different header.php for AMP (header_amp.php)
Last modified: November 8, 2022

---

# Using a different header.php for AMP (header_amp.php)

 *  Resolved [therinjfoundation](https://wordpress.org/support/users/therinjfoundation/)
 * (@therinjfoundation)
 * [3 years, 7 months ago](https://wordpress.org/support/topic/using-a-different-header-php-for-amp-header_amp-php/)
 * Here is the question.
    Using “transitional” If I wish to use the same theme for
   html and AMP, but for AMP use a different header.php i.e.: header_amp.php How
   would I do that?
    -  This topic was modified 3 years, 7 months ago by [therinjfoundation](https://wordpress.org/support/users/therinjfoundation/).
    -  This topic was modified 3 years, 7 months ago by [therinjfoundation](https://wordpress.org/support/users/therinjfoundation/).

Viewing 2 replies - 1 through 2 (of 2 total)

 *  Plugin Support [Milind More](https://wordpress.org/support/users/milindmore22/)
 * (@milindmore22)
 * [3 years, 7 months ago](https://wordpress.org/support/topic/using-a-different-header-php-for-amp-header_amp-php/#post-16181012)
 * Hello [@therinjfoundation](https://wordpress.org/support/users/therinjfoundation/)
 * Thank you for contacting us, Yes you can use a different header for AMP pages
 * You can use the [amp_is_request](https://amp-wp.org/reference/function/amp_is_request/)
   function to determine if you are on the AMP page.
 * eg:
 *     ```
       if ( function_exists( 'amp_is_request' ) && amp_is_request() ) {
       	get_header( 'amp' );
       } else {
       	get_header();
       }
       ```
   
 * Now add **header-amp.php** in your themes directory (in case you are using a 
   theme from the WordPress repo, we will recommend using a child theme.)
 * Also please note that it’s not an underscore (_) but it’s dash (-) that need 
   while creating a custom header.
 * You can learn more about it in WordPress documentation about [get_header()](https://developer.wordpress.org/reference/functions/get_header/#comment-462)
 * I hope this helps!
 *  Plugin Support [Milind More](https://wordpress.org/support/users/milindmore22/)
 * (@milindmore22)
 * [3 years, 6 months ago](https://wordpress.org/support/topic/using-a-different-header-php-for-amp-header_amp-php/#post-16211780)
 * [@therinjfoundation](https://wordpress.org/support/users/therinjfoundation/) 
   As we didn’t receive a response I’ll mark this as resolved. Feel free to open
   a [new support topic](https://wordpress.org/support/plugin/amp/#new-post) if 
   you require any further assistance.

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Using a different header.php for AMP (header_amp.php)’ is closed to new
replies.

 * ![](https://ps.w.org/amp/assets/icon.svg?rev=2527602)
 * [AMP](https://wordpress.org/plugins/amp/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/amp/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/amp/)
 * [Active Topics](https://wordpress.org/support/plugin/amp/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/amp/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/amp/reviews/)

## Tags

 * [header.php](https://wordpress.org/support/topic-tag/header-php/)

 * 2 replies
 * 2 participants
 * Last reply from: [Milind More](https://wordpress.org/support/users/milindmore22/)
 * Last activity: [3 years, 6 months ago](https://wordpress.org/support/topic/using-a-different-header-php-for-amp-header_amp-php/#post-16211780)
 * Status: resolved