Tagged: x
-
AuthorPosts
-
April 20, 2016 at 8:04 am #891727
Kristian73ParticipantMy website started as strictly Ohio Festivals, but I now have festival listings for other states.
Therefore, I was wondering if I was able to switch the header Ohio Festivals image (above navbar) to show the Featured Image of that page instead. I want to do this because some people come for the Michigan Festival Schedule page (for example) and the page loads with an Ohio Festivals logo at the top – they get confused as a result.
If the top image was still linked to the home page, great! If not, then I could possibly add a button in the Navbar for Home.
Thanks for your help!
April 20, 2016 at 8:04 am #891728
Kristian73Participantohiofestivals.net – sorry.
April 20, 2016 at 12:57 pm #892241
ThaiModeratorHi There,
Because this requires a template change, I’d advise that you setup a child theme. This allows you to make code changes that won’t be overwritten when an X update is released. After your child theme is setup, please review how we recommend making template changes in Customization Best Practices.
Then navigate to your child theme’s /framework/views/global directory create a file named _navbar.php and paste the code below:<?php // ============================================================================= // VIEWS/GLOBAL/_NAVBAR.PHP // ----------------------------------------------------------------------------- // Outputs the navbar. // ============================================================================= $navbar_position = x_get_navbar_positioning(); $logo_nav_layout = x_get_logo_navigation_layout(); $is_one_page_nav = x_is_one_page_navigation(); ?> <?php if ( ( $navbar_position == 'static-top' || $navbar_position == 'fixed-top' || $is_one_page_nav ) && $logo_nav_layout == 'stacked' ) : ?> <div class="x-logobar"> <div class="x-logobar-inner"> <div class="x-container max width"> <?php if( !is_home() && !is_single() && !is_front_page() ){ echo '<a href="'.home_url().'" class="x-brand img" title="">'.get_the_post_thumbnail( get_the_ID(), 'full' ).'</a>'; } else { x_get_view( 'global', '_brand' ); } ?> </div> </div> </div> <div class="x-navbar-wrap"> <div class="<?php x_navbar_class(); ?>"> <div class="x-navbar-inner"> <div class="x-container max width"> <?php x_get_view( 'global', '_nav', 'primary' ); ?> </div> </div> </div> </div> <?php else : ?> <div class="x-navbar-wrap"> <div class="<?php x_navbar_class(); ?>"> <div class="x-navbar-inner"> <div class="x-container max width"> <?php x_get_view( 'global', '_brand' ); ?> <?php x_get_view( 'global', '_nav', 'primary' ); ?> </div> </div> </div> </div> <?php endif; ?>Hope it helps 🙂
April 20, 2016 at 1:46 pm #892295
Kristian73ParticipantIt worked. Thanks so much!
April 20, 2016 at 10:51 pm #892941
Prasant RaiModeratorYou are most welcome. 🙂
-
AuthorPosts
- <script> jQuery(function($){ $("#no-reply-891727 .bbp-template-notice, .bbp-no-topic .bbp-template-notice").removeClass('bbp-template-notice'); }); </script>
