Navigation
This is archived content. Visit our new forum.

Tagged: 

  • Author
    Posts
  • #1113768

    Wytseg
    Participant

    Hey Guys,

    I’m trying to make a 2 pages in a different color scheme (BLACK), for this, the logo has to change because it would otherwise submerge in the blackness.

    I’ve used to code provide here: https://community.theme.co/forums/topic/logo-change-for-a-specific-page/

    But changed it to this:

    
    <?php
    
    // =============================================================================
    // VIEWS/GLOBAL/_BRAND.PHP
    // -----------------------------------------------------------------------------
    // Outputs the brand.
    // =============================================================================
    
    $site_name        = get_bloginfo( 'name' );
    $site_description = get_bloginfo( 'description' );
    $logo             = x_make_protocol_relative( x_get_option( 'x_logo' ) );
    $site_logo        = '<img src="' . $logo . '" alt="' . $site_description . '" />';
    
    if ( is_page(‘hardstyle-mixing’) ) { 
        $site_logo        = '<img src="https://whiteseastudio.com/wp-content/uploads/2016/08/White-Sea-Logo-front-WHITE.png" alt="Logo" />';
    
    }
    
    ?>
    
    <?php echo ( is_front_page() ) ? '<h1 class="visually-hidden">' . $site_name . '</h1>' : ''; ?>
    
    <a class="<?php x_brand_class(); ?>" title="<?php echo $site_description; ?>">
      <?php echo ( $logo == ‘’ && !is_page(‘hardstyle-mixing’) ) ? $site_name : $site_logo; ?>
    </a>

    When I put the _Brand.php in my child theme, every page will get the “white” logo, and not only the hardstyle-mixing page.

    #1113852

    Rahul
    Moderator

    Hey There,
    Would you mind providing us with login credentials so we can take a closer look? To do this, you can make a post with the following info:
    – Link to your site
    – WordPress Admin username / password
    Don’t forget to select Set as private reply. This ensures your information is only visible to our staff.
    Thanks.

    #1114035

    Wytseg
    Participant
    This reply has been marked as private.
    #1114141

    Darshana
    Moderator

    Hi there,

    Please provide us with your FTP credentials, so that we can check your child theme setup and check the code.

    Thanks!

    #1115035

    Wytseg
    Participant

    There is no FTP on my server. I have SSH, but that is secured so thoroughly that you need a certificate for that.. I need to ask my server-guys about how to login, is there another way to do it? Can’t I just WeTransfer the whole folder?

    #1115210

    Christopher
    Moderator

    Hi there,

    Please update your code to :

    <?php
    
    // =============================================================================
    // VIEWS/GLOBAL/_BRAND.PHP
    // -----------------------------------------------------------------------------
    // Outputs the brand.
    // =============================================================================
    
    $site_name        = get_bloginfo( 'name' );
    $site_description = get_bloginfo( 'description' );
    $logo             = x_make_protocol_relative( x_get_option( 'x_logo' ) );
    $site_logo        = '<img src="' . $logo . '" alt="' . $site_description . '" />';
    
    if ( is_page('hardstyle-mixing') ) { 
        $site_logo        = '<img src="https://whiteseastudio.com/wp-content/uploads/2016/08/White-Sea-Logo-front-WHITE.png" alt="Logo" />';
    
    }
    
    ?>
    
    <?php echo ( is_front_page() ) ? '<h1 class="visually-hidden">' . $site_name . '</h1>' : ''; ?>
    
    <a class="<?php x_brand_class(); ?>" title="<?php echo $site_description; ?>">
      <?php echo ( $logo == '' && !is_page('hardstyle-mixing') ) ? $site_name : $site_logo; ?>
    </a>

    Hope it helps.

    #1115285

    Wytseg
    Participant

    That works!

    There is another page that needs the white logo, can I just duplicate this line?

    if ( is_page('hardstyle-mixing') ) { 
        $site_logo        = '<img src="https://whiteseastudio.com/wp-content/uploads/2016/08/White-Sea-Logo-front-WHITE.png" alt="Logo" />';
    
    }
    #1115384

    Thai
    Moderator

    Hi There,

    Please try with this:

    if ( is_page( array('hardstyle-mixing', 'your-page-slug') ) ) { 
        $site_logo        = '<img src="https://whiteseastudio.com/wp-content/uploads/2016/08/White-Sea-Logo-front-WHITE.png" alt="Logo" />';
    }

    Hope it helps 🙂