Tagged: x
-
AuthorPosts
-
July 18, 2016 at 12:42 pm #1092182
Jennifer PParticipantHi! 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!
July 18, 2016 at 3:19 pm #1092392
DarshanaModeratorHi 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.
July 19, 2016 at 1:11 am #1092986
Jennifer PParticipantThat worked perfect. Thanks!!
July 19, 2016 at 2:45 am #1093065
RupokMemberYou 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!
July 19, 2016 at 2:13 pm #1094031
Jennifer PParticipantOkay, 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!
July 19, 2016 at 2:27 pm #1094058
Nabeel AModeratorHi 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!
July 19, 2016 at 3:09 pm #1094103
Jennifer PParticipantNope, this isn’t doing it either. Any other ideas?
July 19, 2016 at 3:21 pm #1094122
Jennifer PParticipantUsing:
if(is_archive()) {
$site_logo = ‘
‘;
}This makes the logo change for the archive and category pages. But not on the single post pages.
July 19, 2016 at 3:23 pm #1094126
Jennifer PParticipantHowever, looking at it now it’s changing the size of the logo on the archive and category pages. Hmmm.
July 19, 2016 at 6:42 pm #1094337
JadeModeratorHi 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 credentialsDon’t forget to select Set as private reply. This ensures your information is only visible to our staff.
July 20, 2016 at 12:14 am #1094787
Jennifer PParticipantThis reply has been marked as private.July 20, 2016 at 2:34 am #1094916
Paul RModeratorHi 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
July 24, 2016 at 4:51 pm #1100987
Jennifer PParticipantThat did it. Thanks! One other issue now, the logo no longer links to my home page.
July 24, 2016 at 8:39 pm #1101200
RadModeratorHi 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!
-
AuthorPosts
- <script> jQuery(function($){ $("#no-reply-1092182 .bbp-template-notice, .bbp-no-topic .bbp-template-notice").removeClass('bbp-template-notice'); }); </script>
