No stylesheet at all
-
On my local environment, I’m trying to implement AMP with this plugin in the Paired mode, but once I activate it, no stylesheet at all is outputted in the style[amp-custom] .
This is my code activating the paired mode:
add_action('after_setup_theme', 'gong_amp_register_template'); function gong_amp_register_template() { add_theme_support( 'amp', array( 'template_dir' => 'templates/amp', 'available_callback' => 'is_singular', 'comments_live_list' => false ) ); }
Even if I try to dequeue and enqueue a specific stylesheet, still nothing is outputted in the style:
//Register the proper amp style //add_action( 'wp_enqueue_scripts', 'gong_amp_stylesheet', 20 ); function gong_amp_stylesheet() { if ( function_exists( 'is_amp_endpoint' ) && is_amp_endpoint() ) { wp_dequeue_style( get_template() . '-ie8' ); wp_dequeue_style( get_template() . '-style' ); wp_dequeue_style( get_template() . '-fonts' ); wp_dequeue_style( 'fontawesome' ); wp_dequeue_style( 'theme-style' ); wp_enqueue_style( 'gong-amp', get_stylesheet_directory_uri() . '/assets/css/amp.css', array(), '0.2' ); } }
The structure work as intended, I mean, it’s in fact getting the HTML structure from my desired template. If I put the style inline, it does work as well, but it doesn’t if I put it in the style file.
No error is outputted either, nor saved in the apache log. Also, I’ve outputed wp_styles after header in the amp template and I can confirm that the proper style were invoked during the execution.
I’m running this inside a Multisite install and in an wamp environment using a custom domain alias. Could this be related?
- The topic ‘No stylesheet at all’ is closed to new replies.