• Resolved Tankman15

    (@tankman15)


    I would like to remove the .site-branding from my website.

    I have placed the following code into my functions.php:
    // add custom logo to website
    add_action( ‘init’, ‘storefront_custom_logo’ );
    function storefront_custom_logo() {
    remove_action( ‘storefront_header’, ‘storefront_site_branding’, 20 );
    add_action( ‘storefront_header’, ‘storefront_display_custom_logo’, 20 );

    Which I believe should remove the .site-branding from the header and I have also hidden it in my css:
    /* Remove the site name from the header.
    ————————————————————– */
    .site-branding {
    visibility: hidden;
    display: none;
    }

    But it still remains present:
    http://sherman.digital-realms.co.uk

    Thanks in advanced for any help.

Viewing 6 replies - 1 through 6 (of 6 total)
  • What theme are you using? Where did you download it from?

    Thread Starter Tankman15

    (@tankman15)

    This is a child theme created by me. So it wasn’t downloaded but more along the lines it was created.

    Below is CSS and the functions.php files (if that helps).
    [Moderated]

    Thread Starter Tankman15

    (@tankman15)

    Oh and the functions.php looks like this:

    <?php

    // Import Storefront Styles
    function theme_enqueue_styles() {

    $parent_style = ‘storefront’;

    wp_enqueue_style( $parent_style, get_template_directory_uri() . ‘/style.css’ );
    wp_enqueue_style( ‘child-style’,
    get_stylesheet_directory_uri() . ‘/style.css’,
    array( $parent_style )
    );
    }
    add_action( ‘wp_enqueue_scripts’, ‘theme_enqueue_styles’ );

    // Remove WooThemes Credit from Footer
    add_action( ‘init’, ‘custom_remove_footer_credit’, 10 );
    function custom_remove_footer_credit () {
    remove_action( ‘storefront_footer’, ‘storefront_credit’, 20 );
    add_action( ‘storefront_footer’, ‘custom_storefront_credit’, 20 );
    }
    function custom_storefront_credit() {
    ?>
    <div class=”site-info”>
    © <?php echo get_bloginfo( ‘name’ ) . ‘ ‘ . get_the_date( ‘Y’ ); ?>
    </div><!– .site-info –>
    <?php
    }

    // add custom logo to website
    add_action( ‘init’, ‘storefront_custom_logo’ );
    function storefront_custom_logo() {
    remove_action( ‘storefront_header’, ‘storefront_site_branding’, 20 );
    add_action( ‘storefront_header’, ‘storefront_display_custom_logo’, 20 );
    }

    function storefront_display_custom_logo() {
    ?>
    ” class=”site-logo-link” rel=”home”>
    <img class=”logocent” src=”<?php echo get_stylesheet_directory_uri(); ?>/images/logo.png” alt=”<?php echo get_bloginfo( ‘name’ ); ?>” />

    <?php
    }

    // Remove search bar from the header.
    add_action( ‘init’, ‘jk_remove_storefront_header_search’ );
    function jk_remove_storefront_header_search() {
    remove_action( ‘storefront_header’, ‘storefront_product_search’, 40 );
    }

    // Rename the menu in mobile view
    function storefront_primary_navigation() {
    ?>
    <nav id=”site-navigation” class=”main-navigation” role=”navigation”>
    <button class=”menu-toggle”><?php _e( ‘Branded Fashion’, ‘storefront’ ); ?></button>
    <?php wp_nav_menu( array( ‘theme_location’ => ‘primary’ ) ); ?>
    </nav><!– #site-navigation –>
    <?php
    }

    // Remove the shipping cart from the main menu
    add_action( ‘init’, ‘woa_remove_header_cart’ );
    function woa_remove_header_cart() {
    remove_action( ‘storefront_header’, ‘storefront_header_cart’, 60 );
    }

    // Allow shortcodes in Widgets
    add_filter(‘widget_text’, ‘do_shortcode’);

    // Create the function button
    function sButton($atts, $content = null) {
    extract(shortcode_atts(array(‘link’ => ‘#’), $atts));
    return ‘<span>’ . do_shortcode($content) . ‘</span>‘;
    }
    add_shortcode(‘button’, ‘sButton’);

    // End of file
    ?>

    I hope that might help a little.

    Andrew Nevins

    (@anevins)

    WCLDN 2018 Contributor | Volunteer support

    @tankman15, Your CSS is viewable from your website. You don’t need to post it, unless you know of specific lines of CSS that are relevant to the question.

    Thread Starter Tankman15

    (@tankman15)

    Thank you Andrew, I forgot that if you inspect element you can see the css file from there.

    I don’t think it is the .site-branding which is causing the problem. I want to move my logo up and yesterday while inspecting the element I saw .site-branding and I thought that is what was causing the issue.

    Is .site-branding still active or is this just a padding and margin fault?

    Thread Starter Tankman15

    (@tankman15)

    OK I did inspect the element and yes .site-branding was still present. So I set the height and width to 0px; and that solved the issue. Thanks guys.

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘remove .site-branding’ is closed to new replies.