Site logo

[Support request] Site Title, Tag Line + Mobile Header Layout

Home Forums Support [Support request] Site Title, Tag Line + Mobile Header Layout

Home Forums Support Site Title, Tag Line + Mobile Header Layout

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #2496000
    William

    Hello,
    Can you shed any light on how I can recreate this Logo + Tag Line layout on GeneratePress on Mobile so that the logos remain side by side and then wrap underneath on smaller screen sizes.

    I’m currently using this CSS, found on another closed support article to make the logo and tag line appear side by side:

    .site-branding > * {
    display: inline-block;
    }

    .site-logo {
    margin-right: 10px;
    }

    .main-title {
    padding-right: 1px;
    margin-right: 1px;
    }

    #2496119
    David
    Staff
    Customer Support

    Hi there,

    so that site is pure HTML and its using HTML text for that.
    Can i see the site you’re working on? Then i can advise on the best way to do that.

    #2496126
    William

    Thankyou for taking a look.

    This is the website that we’re working on: https://andrew-wallace-architects.onyx-sites.io/

    #2496138
    David
    Staff
    Customer Support

    Ok, so we need to split the site-description into two HTML elements, to do that requires some PHP.
    Add this PHP Snippet to your site:

    add_filter( 'generate_site_description_output', function(){
        return sprintf(
            '<p class="site-description"%1$s>
                line one of description
            </p>
            <p class="site-description"%1$s>
                line two of description
            </p>
            ',
            'microdata' === generate_get_schema_type() ? ' itemprop="description"' : ''
        )
    });

    change the two lines to your requirements.

    Then add this CSS:

    /* inline title and 2 descriptions */
    .site-branding {
        display: flex;
        align-items: end;
        flex-wrap: wrap;
    }
    /* Optional Add some space after title */
    .main-title {
        margin-right: 10px;
    }
    /* Make it wrap on mobile */
    @media(max-width: 768px) {
        .site-branding {
            max-width: 300px;
        }
    }

    Note the last CSS rule, you can adjust the @media(max-width: 768px) to a screen size when you want the description to wrap, and you will need to adjust the max-width: 300px; to force it to wrap.

Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.