Navigation
This is archived content. Visit our new forum.

Tagged: 

  • Author
    Posts
  • #1092182
    Jennifer P
    Participant

    Hi! I had the blog pages all working with the correct logo using this code in the x-child > framework > views > global > _brand.php :

    <?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_home()) {
        $site_logo        = '<img src="http://www.qboxmonthly.com/images/safehouse-logo.png" alt="The Safe House" />';
    }
    ?>
    
    <?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 == '' ) ? $site_name : $site_logo; ?>
      
    </a>

    However, with the latest upgrade, the logo is only showing on the main blog page, not on any of the single post or archive pages. Can you help?

    Blog: http://www.qboxmonthly.com/blog/

    Thanks!

    #1092392
    Darshana
    Moderator

    Hi there,

    Please try updating your code as follows.

    
    <?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_home()) {
        $site_logo        = '<img src="http://www.qboxmonthly.com/images/safehouse-logo.png" alt="The Safe House" />';
    }
    
    if(is_single()) {
        $site_logo        = '<img src="http://www.qboxmonthly.com/images/safehouse-logo.png" alt="The Safe House" />';
    }
    ?>
    
    <?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 == '' ) ? $site_name : $site_logo; ?>
      
    </a>
    

    Hope that helps.

    #1092986
    Jennifer P
    Participant

    That worked perfect. Thanks!!

    #1093065
    Rupok
    Member

    You are welcome!

    Glad that it helped. Feel free to let us know if you face any other issue. We’ll be happy to assist you.

    Thanks for using X.

    Cheers!

    #1094031
    Jennifer P
    Participant

    Okay, actually, not perfect. LOL. I just noticed that this code is changing the logo on product pages as well as post pages. I’d like it not to change on the product pages. Is there a fix for that? Thanks!

    #1094058
    Nabeel A
    Moderator

    Hi again,

    Try replacing the previous code with this one:

    <?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_home()) {
        $site_logo        = '<img src="http://www.qboxmonthly.com/images/safehouse-logo.png" alt="The Safe House" />';
    }
    
    if(is_post_type_archive()) {
        $site_logo        = '<img src="http://www.qboxmonthly.com/images/safehouse-logo.png" alt="The Safe House" />';
    }
    ?>
    
    <?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 == '' ) ? $site_name : $site_logo; ?>
      
    </a>

    Let us know how this goes!

    #1094103
    Jennifer P
    Participant

    Nope, this isn’t doing it either. Any other ideas?

    #1094122
    Jennifer P
    Participant

    Using:

    if(is_archive()) {
    $site_logo = ‘The Safe House‘;
    }

    This makes the logo change for the archive and category pages. But not on the single post pages.

    #1094126
    Jennifer P
    Participant

    However, looking at it now it’s changing the size of the logo on the archive and category pages. Hmmm.

    #1094337
    Jade
    Moderator

    Hi Jennifer,

    Would you mind providing us with login credentials so we can take a closer look and we could test it? To do this, you can make a post with the following info:

    – Link to your site
    – WordPress Admin username / password
    – FTP credentials

    Don’t forget to select Set as private reply. This ensures your information is only visible to our staff.

    #1094787
    Jennifer P
    Participant
    This reply has been marked as private.
    #1094916
    Paul R
    Moderator

    Hi Jennifer,

    Please change your code to this.

    
    if(is_archive() || is_singular('post')) {
          $site_logo = '<img src="http://www.qboxmonthly.com/images/safehouse-logo.png" alt="The Safe House">';
    }
    

    Then to adjust the size, you can add this under Custom > CSS in the Customizer.

    
    .single-post .x-brand img,
    .archive .x-brand img {
        width: 175px;
    }
    

    Change 175px to achieve the size that you want in your archive and post page

    Hope that helps

    #1100987
    Jennifer P
    Participant

    That did it. Thanks! One other issue now, the logo no longer links to my home page.

    #1101200
    Rad
    Moderator

    Hi there,

    You have to wrap it with a link, like this,

    if(is_archive() || is_singular('post')) {
          $site_logo = '<a href="'.home_url().'"><img src="http://www.qboxmonthly.com/images/safehouse-logo.png" alt="The Safe House"></a>';
    }

    Cheers!

  • <script> jQuery(function($){ $("#no-reply-1092182 .bbp-template-notice, .bbp-no-topic .bbp-template-notice").removeClass('bbp-template-notice'); }); </script>