amp-wp icon indicating copy to clipboard operation
amp-wp copied to clipboard

Put logo in the title bar

Open alessandromoretti90 opened this issue 10 years ago • 4 comments

Hi, I wanted to delete the icon and title by putting an image (logo) in the middle of the title bar.

How can I do?

alessandromoretti90 avatar Feb 20 '16 14:02 alessandromoretti90

Check out https://github.com/Automattic/amp-wp/blob/master/readme.md#logo-only

mjangda avatar Feb 24 '16 03:02 mjangda

I entered the code but it doesn't seem to work. I entered all the custom css in this way:

add_action( 'amp_post_template_css', 'xyz_amp_additional_css_styles' );

function discover_fp_amp_additional_css_styles( $amp_template ) {
    ?>
    .byline amp-img {
        border-radius: 0;
    }

    nav.title-bar {
    background: #ef5730;
    padding: 0 16px;
    }

    nav.amp-wp-title-bar a {
        background-image: url( 'http://overpress.it/logo-overpress-2x-bianco.png' );
        background-repeat: no-repeat;
        background-size: contain;
        display: block;
        height: 28px;
        width: 94px;
        margin: 0 auto;
        text-indent: -9999px;
    }

    tax-tag {
    display: none;
    }

    posted-on {
    display: none;
    }

    .title {
    font-family: 'Open Sans', arial, sans-serif;
    margin: 36px 0 0 0;
    font-size: 32px;
    line-height: 1.258;
    font-weight: 400;
    color: #000;
    }

    .content {
    font-family: Verdana, Geneva, sans-serif;
    padding: 16px;
    overflow-wrap: break-word;
    word-wrap: break-word;
    font-weight: 400;
    font-size: 14px;
    color: #000;
    }

    .meta {
    margin-bottom: 16px;
    font-family: 'Open Sans', arial, sans-serif;
    font-size: 14px;
    color: #444444;
    font-style: italic;
    }
    <?php
}

This is the result (nothing has changed) -> http://overpress.it/2016/02/21/mwc-2016-samsung-galaxy-s7/amp/

alessandromoretti90 avatar Feb 24 '16 09:02 alessandromoretti90

Sorry, there was a typo in the code snippet. It should be:

add_action( 'amp_post_template_css', 'xyz_amp_additional_css_styles' );

function xyz_amp_additional_css_styles( $amp_template ) {

mjangda avatar Feb 24 '16 15:02 mjangda

OK, now the logo appears. But because the rest of custom CSS that before it worked now after the update, doesn't work anymore?

alessandromoretti90 avatar Feb 24 '16 15:02 alessandromoretti90