• Resolved dutchintouch

    (@dutchintouch)


    If I want to make changes to the AMP template, do I create a separate child theme for AMP? If so, should that child theme be placed in the Themes folder?

    Also, when the readme at Github mentions functions.php, is that file within the AMP child theme?

Viewing 2 replies - 1 through 2 (of 2 total)
  • Hello Dutchintouch:
    This info was hard to find, and should be included in FAQ.

    Copy AMP templates from plugin to a new directory in child theme.
    Then add a filter to amp_post_template_dir.
    Example:

    function vbp_get_amp_template_path($p) {
       return get_stylesheet_directory() . '/blog_amp'; // amp-templates
    }
    
    add_filter( 'amp_post_template_dir', 'vbp_get_amp_template_path' );

    I found info here.

    AMP requires customization for your site. I created a separate file for AMP functions by adding code to child theme’s functions.php:

    if (strstr($_SERVER['REQUEST_URI'], '/amp/')) {
       require_once 'amp_functions.php';
    }

    Best wishes,
    Mitchell

    Thanks Mitchell. Moving my amp theme files to an amp folder in my main theme folder worked for me

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘AMP child theme’ is closed to new replies.