Created
August 19, 2021 10:01
-
-
Save milindmore22/7fd81d260744ec4fc875982eb3ac5757 to your computer and use it in GitHub Desktop.
Add CSS to AMP Legacy theme.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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