New Landing How can we help? Cardinal Cardinal update has broken Header 4

Viewing 9 posts - 1 through 9 (of 9 total)
  • Posted in: Cardinal
  • #205374
    mcheck
    Member
    Post count: 44

    After the latest Cardinal update, the Header 4 still has a remanent from the previous config fields. You can see it on the header of our site.

    It appears that the config option name settings were changed for the Top Bar Left (and Right) Config to using: tb_right_text and related

    Snippet of current options json:
    "tb_left_config";s:4:"text";s:12:"tb_left_text";s:25:"Top Bar Left Config Field";s:15:"tb_right_config";s:0:"";s:13:"tb_right_text";s:0:"";s:13:"header_layout";s:8:"header-4";s:

    It used to be header_right_text and related

    Snippet of old:
    "header_left_config";s:0:"";s:16:"header_left_text";s:49:"Contact us at 212-555-1212 or [email protected]";s:19:"header_right_config";s:0:"";s:17:"header_right_text";s:49:"Contact us at 212-555-1212 or [email protected]";s:21:"c

    I would guess there still parts of the old settings in the Header 4 code? Can you help me with this?

    #205455
    mcheck
    Member
    Post count: 44

    I was confused. The swift variables are correct and have not changed, but the issue with Header 4 remains. You can still see it in the url.

    I think it is in the function sf_header_aux which does not check to see if the header_right_config is not set to text before adding the header_right_text.

    So that option for Header Right/Left Text Config can be set to nothing, but will still output the text in those headers that call it.

    In the sf_header_aux function, you can change lines 215 and 237 to an else if:

    
                    } else if ( $header_right_config == "text" ) {
                        $header_right_output .= '<div class="text">' . do_shortcode( $header_right_text ) . '</div>' . "\n";
                    }
    
                    return $header_right_output;
    

    For now, I just removed the text in the header_right_text and so nothing is there any longer.

    #205475
    Swift Ideas – Ed
    Keymaster
    Post count: 15264

    Hi there,

    How did you update to the latest version? Checked here and not able to replicate locally. Do you have any child theme customisations?

    – Ed

    #205516
    mcheck
    Member
    Post count: 44

    Thanks for the response.

    I do have child theme customizations but only adding category filtering functions to Ess Grids and Portfolios for the admin.

    I’m not sure why it is appearing, but it is there.

    I updated from the theme pages in wp-admin.

    In Theme Options:
    Select Header 4.
    Select Text/Shortcode for Header Right Text
    Add some text in field.

    I checked the Cardinal Options object, and the header_right_config shows “”, but since sf-header.php is called from header-4, header_right_text gets populated.

    I should say that no other right elements are on, like social, search, etc.

    I have the theme loaded in wpengine at the older version and with the same configuration, it does NOT show the header_right_text. Weird.

    Would it make sense to add the else if where I pointed out above?

    #205902
    Swift Ideas – Ed
    Keymaster
    Post count: 15264

    Have you overridden any of the theme’s header output? The strange thing here is that header 4 doesn’t have a header right output – the cart/wishlist is there by default.

    – Ed

    #205909
    mcheck
    Member
    Post count: 44

    I have not overridden it.

    Here is my cardinal/template-parts/header/header-4.php

    My line 14 shows that sf_header_aux( ‘right’ ) is being called, and with header_right_config set to “” I get the header_right_text

    
    <?php
    
    	/*
    	*
    	*	Header 4
    	*	------------------------------------------------
    	* 	Copyright Swift Ideas 2015 - http://www.swiftideas.com
    	*
    	*	Output for header-4
    	*
    	*/
    	
    	global $sf_options;
    	$header_right_output = sf_header_aux( 'right' );
    	$fullwidth_header    = $sf_options['fullwidth_header'];
    ?>
    
    <?php if ( $fullwidth_header ) { ?>
    <header id="header" class="sticky-header fw-header clearfix">
    <?php } else { ?>
    <header id="header" class="sticky-header clearfix">
    <?php } ?>
    	<div class="container"> 
    		<div class="row"> 
    			
    			<?php echo sf_logo( 'col-sm-4 logo-left' ); ?>
    			
    			<div class="header-right">
    				<?php echo $header_right_output; ?>
    			</div>
    			
    			<?php echo sf_main_menu( 'main-navigation', 'float-2' ); ?>
    			
    		</div> <!-- CLOSE .row --> 
    	</div> <!-- CLOSE .container --> 
    </header> 
    
    #205914
    Swift Ideas – Ed
    Keymaster
    Post count: 15264

    Here is what header-4.php should be (and is exactly what it is in the latest update):

    <?php
    
    	/*
    	*
    	*	Header 4
    	*	------------------------------------------------
    	* 	Copyright Swift Ideas 2015 - http://www.swiftideas.com
    	*
    	*	Output for header-4
    	*
    	*/
    	
    	global $sf_options;
    	$fullwidth_header    = $sf_options['fullwidth_header'];
    ?>
    
    <?php if ( $fullwidth_header ) { ?>
    <header id="header" class="sticky-header fw-header clearfix">
    <?php } else { ?>
    <header id="header" class="sticky-header clearfix">
    <?php } ?>
    	<div class="container"> 
    		<div class="row"> 
    			
    			<?php echo sf_logo( 'col-sm-4 logo-left' ); ?>
    			
    			<?php echo sf_main_menu( 'main-navigation', 'float-2' ); ?>
    			
    		</div> <!-- CLOSE .row --> 
    	</div> <!-- CLOSE .container --> 
    </header> 

    – Ed

    #205925
    mcheck
    Member
    Post count: 44

    Yikes! Thanks Ed. I wonder what other files are not in sync.

    What would you suggest as the best method to update?
    I used the WP Admin update, but obviously something did not work as expected.

    Just delete and reload from ThemeForest download?

    Thanks, Mike

    #206121
    Kyle – SUPPORT
    Moderator
    Post count: 35880

    Updating through the admin should work fine, not sure what happened there

    – Kyle

Viewing 9 posts - 1 through 9 (of 9 total)

You must be logged in and have valid license to reply to this topic.

License required for one of the following items
Login and Registration Log in · Register