Skip to content

Instantly share code, notes, and snippets.

@milindmore22
Created August 19, 2021 10:01
Show Gist options
  • Save milindmore22/7fd81d260744ec4fc875982eb3ac5757 to your computer and use it in GitHub Desktop.
Save milindmore22/7fd81d260744ec4fc875982eb3ac5757 to your computer and use it in GitHub Desktop.
Add CSS to AMP Legacy theme.
<?php
/**
* Plugin Name: AMP Legacy Theme CSS
* Plugin URI: https://amp-wp.org
* Description: Plugin add CSS to AMP Legacy theme.
* Version: 1
* Requires at least: 5.6
* Requires PHP: 7.4
* Author: AMP Support
* Author URI: https://wpindia.co.in/
* License: GPL v2 or later
* License URI: https://www.gnu.org/licenses/gpl-2.0.html
* Update URI: https://example.com/my-plugin/
* Text Domain: amp-legacy-theme-css
* Domain Path: /languages
*/
add_action(
'amp_post_template_css',
function () {
// only CSS here please...
?>
nav.uk-navbar-container .uk-navbar-left, header#site-header>.uk-container .uk-navbar-container .uk-navbar-right, #offcanvas-nav {
display: none;
}
main#site-main {
width: 100%;
display: inline-block;
position: relative;
clear: both;
}
footer.site-footer {
position: relative;
display: inline-block;
width: 100%;
height: auto;
}
header#site-header>.uk-container {
padding: 10px;
}
<?php
}
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment