Want to hide the site text and just show a logo on AMP pages in WordPress? If you want to hide the site text and just show a logo, use the amp_post_template_css action.
The following colors the title bar black, hides the site title, and replaces it with a centered logo:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 | add_action( 'amp_post_template_css', 'xyz_amp_additional_css_styles' ); function xyz_amp_additional_css_styles( $amp_template ) { // only CSS here please... ?> header.amp-wp-header { padding: 12px 0; background: #000; } header.amp-wp-header a { background-image: url( 'https://example.com/path/to/logo.png' ); background-repeat: no-repeat; background-size: contain; display: block; height: 28px; width: 94px; margin: 0 auto; text-indent: -9999px; } <?php } |
If you like this question & answer and want to contribute, then write your question & answer and email to freewebmentor[@]gmail.com. Your question and answer will appear on FreeWebMentor.com and help other developers.