• Resolved John

    (@dsl225)


    Hi there,

    Thanks for your work with this very promising update!

    I did the update on a test server first and the first thing I notice is that sidebars are no more showing up, although widgets are kept as they were in previous version’s settings.

    I got this error:

    PHP Fatal error: Call to undefined function alx_sidebar_primary() in /wp-content/themes/hueman-child-master/sidebar.php on line 2

    I’m using a child theme and I have sidebar.php and sidebar-2.php
    The first lines of sidebar.php are:

    <?php
    	$sidebar = alx_sidebar_primary();
    	$layout = alx_layout_class();
    	if ( $layout != 'col-1c'):
    ?>

    Problem is I don’t really remember why I have those 2 files in child theme and therefore don’t really know what to edit in there…

    Any ideas?

Viewing 14 replies - 1 through 14 (of 14 total)
  • Theme Author presscustomizr

    (@nikeo)

    Hi John,
    Thanks for your nice comment ??

    The way the widgets zones are being rendered has changed in the files sidebar.php and sidebar-2.php of the new version.

    Things to modify in your child theme file sidebar.php :
    You need to delete the line

    $sidebar = alx_sidebar_primary();

    And you’ll need to replace :

    <?php dynamic_sidebar($sidebar); ?>

    by

    <?php hu_print_widgets_in_location('s1') ?>

    Things to modify in your child theme file sidebar-2.php :
    You need to delete the line

    $sidebar = alx_sidebar_secondary();

    And you’ll need to replace :

    <?php dynamic_sidebar($sidebar); ?>

    by

    <?php hu_print_widgets_in_location('s2') ?>

    Let me know if it helped

    Note : the same logic also applies to the footer, and the header where there are optional dynamic widget zones rendered.

    Thread Starter John

    (@dsl225)

    Many thanks for your feedback but… I’m certainly doing something wrong and there is no change. Still no sidebars.

    My full code for sidebar.php is now:

    <?php
    	$layout = alx_layout_class();
    	if ( $layout != 'col-1c'):
    ?>
    
    	<div class="sidebar s1">
    
    		<a class="sidebar-toggle" title="<?php _e('Expand Sidebar','hueman'); ?>"><i class="fa icon-sidebar-toggle"></i></a>
    
    		<div class="sidebar-content">
    
    			<?php if ( ot_get_option('sidebar-top') != 'off' ): ?>
    			<div class="sidebar-top group">
    				<p><?php _e('Categories','hueman'); ?></p>
    				<?php alx_social_links() ; ?>
    			</div>
    			<?php endif; ?>
    
    			<?php if ( ot_get_option( 'post-nav' ) == 's1') { get_template_part('inc/post-nav'); } ?>
    
    			<?php if( is_page_template('page-templates/child-menu.php') ): ?>
    			<ul class="child-menu group">
    				<?php wp_list_pages('title_li=&sort_column=menu_order&depth=3'); ?>
    			</ul>
    			<?php endif; ?>
    
    			<?php hu_print_widgets_in_location('s1') ?>
    
    		</div><!--/.sidebar-content-->
    
    	</div><!--/.sidebar-->
    
    	<?php if (
    		( $layout == 'col-3cm' ) ||
    		( $layout == 'col-3cl' ) ||
    		( $layout == 'col-3cr' ) )
    		{ get_template_part('sidebar-2'); }
    	?>
    
    <?php endif; ?>

    and for sidebar-2.php:

    <div class="sidebar s2">
    
    	<a class="sidebar-toggle" title="<?php _e('Expand Sidebar','hueman'); ?>"><i class="fa icon-sidebar-toggle"></i></a>
    
    	<div class="sidebar-content">
    
    		<?php if ( ot_get_option('sidebar-top') != 'off' ): ?>
    		<div class="sidebar-top group">
    			<p><?php _e('Links','hueman'); ?></p>
    		</div>
    		<?php endif; ?>
    
    		<?php if ( ot_get_option( 'post-nav' ) == 's2') { get_template_part('inc/post-nav'); } ?>
    
    		<?php hu_print_widgets_in_location('s2') ?>
    
    	</div><!--/.sidebar-content-->
    
    </div><!--/.sidebar-->

    Is there something wrong in there?

    Theme Author presscustomizr

    (@nikeo)

    OK.
    There’s nothing wrong from a pure php standpoint but since the new version has new function names, you’ll need to replace all previous functions by the new ones.
    The simplest way would be to copy the new files sidebar.php and sidebar-2.php in your child theme and apply your previous changes.

    Thread Starter John

    (@dsl225)

    OK, I see.
    I really don’t know what the changes were but I’ll try to compare files with the old original ones and I’ll probably find out.

    Thanks again!

    UPDATE: got it. Setting this as solved.

    Theme Author presscustomizr

    (@nikeo)

    In the mean time, I’ve uploaded a new version of the theme which includes a backward compatibility patch for the functions used in the previous templates.
    This should fix most of the problem with child theme users who are still using the old function names in their templates.

    Thanks for your feedback too, this helps ??

    Thread Starter John

    (@dsl225)

    Great!

    I only wish some “premium” themes and plugins had they same level of quality and responsiveness in their support as for this free theme… Just dreaming.

    UPDATE: I re-uploaded the old files of my child theme and then updated theme to 3.0.6 but I can’t see any change.

    I will anyhow make use of the new files for my child theme and this is not important for me but just wanted to let you know.

    Theme Author presscustomizr

    (@nikeo)

    Fantastic feedback thanks John ??

    Hi Nikeo, got the same problem too. Does WP give me a new update theme signal now again? Or do I need to ftp it over the old theme?

    FTP’ed the old version back, got some other errors too. I have to say that releasing an update with this obvious error should not have been publicly released. Just my 2 cents.

    Same boat here. No sidebars and when I try to create a new “widget” under dynamic sidebars and widgets the new widget always shows as “[inactive]”.

    Nevermind, I figured it out. Major issue… the widget “location” is backwards. I was setting it to “right sidebar” since I wanted it on the right of the content but that doesn’t work. I set the “location” to “left sidebar” and voila, it works.
    I think this is a bug?

    Theme Author presscustomizr

    (@nikeo)

    Hi @theranch, I’m not able to replicate this issue.
    When a new widget zone is created, it is assigned by default to the left sidebar location.
    It can happen that your layout doesn’t have a left sidebar, the newly created widget zone will therefore be displayed as inactive until you select another location, like right sidebar.

    Would you mind sharing screenshots of the problem ?
    Thanks

    Thread Starter John

    (@dsl225)

    When updating I realized that I had sidebar.php and sidebar-2.php in child theme only to get my own titles for them.

    Out of curiosity: as probably most users will want to edit them, why aren’t those titles available for edit in theme’s options?

    Not a problem for me but just wanted to know if there is a particular reason for that.

    Theme Author presscustomizr

    (@nikeo)

    Hi John,
    That’s actually a good point and simple to implement in the customizer.

    I’ve added it as enhancement candidate for the theme ( https://github.com/presscustomizr/hueman/issues/173 )

    thanks

Viewing 14 replies - 1 through 14 (of 14 total)
  • The topic ‘Lost sidebars when updating’ is closed to new replies.