Support » Plugin: AMP » Can’t customize templates – Uncaught Error: Using $this when not in object conte

  • Resolved rinart73

    (@rinart73)


    I copied default templates from ‘plugins/amp/templates’ to the ‘amp-templates’ folder in my theme.

    Then I added following code from docs in the theme’s ‘functions.php’:
    add_theme_support(‘amp’, array(
    ‘template_dir’ => ‘amp-templates’,
    ‘available_callback’ => ‘is_singular’,
    ‘comments_live_list’ => false
    ));

    I’m getting “Uncaught Error: Using $this when not in object context”. Is this a bug and if not, how to access current AMP_Post_Template instance from custom template?
    I’m okay with default templates mostly, but I need to make some changes. I DON’T want to redo all templates from scratch, that’s why I need access.

Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Can’t customize templates – Uncaught Error: Using $this when not in object conte’ is closed to new replies.