Support » Plugin: AMP » Serving Strategy Via Programmatic Access: add_theme_support not working anymore

  • Resolved helmutwalker

    (@helmutwalker)


    I upgraded from 1.2.0 to 1.3.0 and the add_theme_support function stopped working.

    add_theme_support( 'amp', array(
                'template_dir' => 'partials/blog/amp/',
                'templates_supported' => array(
                         'is_singular' => true,
                ),
            ));
Viewing 7 replies - 1 through 7 (of 7 total)
  • Plugin Author Weston Ruter

    (@westonruter)

    It is not working in what way?

    What is the URL to an AMP page on your site that shows a problem?

    The current version of the plugin is 1.4.1 not 1.3.0. Make sure you have the latest.

    Thread Starter helmutwalker

    (@helmutwalker)

    I only have the amp template enabled when the query string is present. In version 1.2.0 this code works, however I tested in both 1.3.0 and 1.4.0 and the amp template shows without the query string present.

    Plugin Author Weston Ruter

    (@westonruter)

    And what about 1.4.1? That is the current version.

    Please share the URL to the page having the problem.

    Thread Starter helmutwalker

    (@helmutwalker)

    This is also happening with 1.4.1. I do not have a live url to share as I am testing upgrading plugins on my local computer first before pushing to our live site.

    But, for example: the url http://www.domain.com/blog/blog1 should show the desktop template while http://www.domain.com/blog/blog1?amp should show the amp template. When I upgraded the plugin the http://www.domain.com/blog/blog1 shows the amp template and disregards my code.

    Plugin Contributor Alain Schlesser

    (@schlessera)

    Did the mode setting perhaps inadvertently change? The behavior you describe sounds like your site was switched from “Transitional”/”Reader” mode to “Standard” mode.

    Can you please verify what mode the plugin is set to in the AMP > Settings screen?

    Thread Starter helmutwalker

    (@helmutwalker)

    I changed the settings to Transitional it is working properly now. In version 1.2.0 the add_theme_support function seemed to override any setting that was in the AMP settings, no matter if it was set to Standard or Transitional, but looks like now it does not. Thanks for the help.

    Plugin Author Weston Ruter

    (@westonruter)

    That’s correct. The theme support call now indicates the default mode but it can be overridden in the admin screen. Glad it is working now.

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Serving Strategy Via Programmatic Access: add_theme_support not working anymore’ is closed to new replies.