• Resolved greg

    (@gllorca)


    Dear Support team,

    Since I updated to your latest version, I am having big troubles with my sidebars.

    First of all, I can no longer dynamically select which sidebar to display.

    Here is what my child code used to look like :
    `sidebar_id = ‘gl_secondary’;
    if ((!is_archive()) && (!is_home()) && (get_post_meta($post->ID, ‘sponsor_id’, true))){
    $sidebar_id = ‘sponsor’;
    }
    //if (get_post_meta($post->ID, ‘sponsor_id’, true)) { $sidebar_id = ‘sponsor’; }
    elseif (is_author()){
    $sp_aut = $wpdb->get_results( ‘SELECT author_id FROM wp_sponsor’);
    $author = get_user_by( ‘slug’, get_query_var( ‘author_name’ ) );
    foreach ( $sp_aut as $sa )
    {
    if ($sa->author_id==$author->ID) { $sidebar_id = ‘sponsor’; }
    }
    }
    elseif ((is_single())||(is_category())){
    $sidebar_id = ‘single_right’;
    }
    dynamic_sidebar( $sidebar_id );`

    With your new version, the code is now:
    <?php hu_print_widgets_in_location('s2'); ?>

    1) How can I dynamically display my “sponsor” sidebar on specifically chosen authors ?

    The second part, which is the biggest problem, is that the theme is no longer responsive.
    I used to have several sidebars that I declared in my functions.php.
    I removed all of that in order to use your new widget system, in hope it would solve my issue (even though it provoked the issue mentionned earlier).
    But it didn’t…

    So, the problem is as follows:
    On wide screens, I have no issue, everything works fine.
    However, on smaller screens, the buttons with the two arrows (that is used to expand the sidebars) no longer works.
    The left sidebar button is located at the bottom of the page, and the right sidebar button is not to be seen.
    http://s32.postimg.org/9rxzzj4wl/Capture3.jpg
    http://s32.postimg.org/qgzfvg1hx/Capture.jpg

    When I open up the left sidebar, I can see it, looking all dirty with scroll bars.
    http://s32.postimg.org/wkcf1m2dx/Capture2.jpg

    This makes the right sidebar button appear. When I click on it, I can see the sidebar, which is clean.
    http://s32.postimg.org/3ynxyyt91/Capture4.jpg

    When I close it, back to the first scenario.
    http://s32.postimg.org/9rxzzj4wl/Capture3.jpg
    http://s32.postimg.org/qgzfvg1hx/Capture.jpg

    2) How can I make sure my sidebar work correctly ?

    PS: I am having lots of issues since your new version, I find it very frustrating that an update causes so many conflicts. Why change the name of the functions at all…

    Thank you for your help, I hope we can solve this issue that is urgent.

Viewing 15 replies - 1 through 15 (of 17 total)
  • the buttons with the two arrows (that is used to expand the sidebars) no longer works.

    This is usually, although not always, indicative of a jquery conflict. Jquery was updated in WP v4.5. If plugins use jquery, and haven’t been updated, there could be an issue.

    the theme is no longer responsive.

    Check Customize > Global settings > Mobile devices, and make sure the Responsive option is enabled.

    Why change the name of the functions at all…

    From a development standpoint, probably to standardize the naming convention with the other theme he manages.

    Thread Starter greg

    (@gllorca)

    Dear DbBrown,

    Thank you for your answer.

    I have checked on my website and I use Jquery v_1.12.3, which is the latest official release.

    When I said that it is no longer responsive, it is due to this problem with the sidebars. Since they don’t work, the theme is no longer responsive.
    However, just to be sure, I double checked the theme settings and the checkbox is checked.

    So, please, let me repeat my two questions :
    1) How can I dynamically select my “sponsor” sidebar for specific author pages ?
    2) How can I have the two sidebar buttons visible on top of the sidebars, at all times and having the left sidebar expanding without any scroll bars ? (instead of having the large left button at the bottom and no button on the right)

    Thank you for your help.

    I just checked your site and it appears to be working normally. The sidebars are collapsing and expanding as designed. Were you able to fix the issue?

    Thread Starter greg

    (@gllorca)

    Dear DdBrown,

    I did not. Which agent were you using ?

    When I test on my desktop, by rezising the browser, it works fine, not matter the viewport.

    However, when I use another agent that as a small viewport, it does not work anymore.

    For instance, here is a good link, to see for yourself :
    http://flexible.gs/responsive-test/?url=http://blog.defi-ecologique.com&col=md

    Thank you for your help.

    I loaded your site on an iPhone 4 using Chrome.

    Thread Starter greg

    (@gllorca)

    And so, on this user agent, there is no issue ?

    What about the link I gave you ?
    http://flexible.gs/responsive-test/?url=http://blog.defi-ecologique.com&col=md

    I tested the website on my tablet (Samsung Galaxy Tab) on Chrome and I have exactly the same issue as visible on the link I just provided.

    And so, on this user agent, there is no issue ?

    Apparently not.

    What about the link I gave you ?

    Yes, I got the same results.

    I also tried it here: http://mobiletest.me/
    It worked on the iPhone 5 but not the iPad Mini emulation.

    Also tried it here: http://responsivetest.net/
    It worked on all four of the Galaxy Tablet emulations, and any other device that I ran it on there.

    Not sure if that’s anything conclusive but those are the results I got. Maybe it’s somehow related to the Chrome installation or configuration on your tablet.

    Thread Starter greg

    (@gllorca)

    I guess not, since it is the same issue on the testing tool.

    Have you heard of any other theme user that has the same issue ?

    If you have any other URL of a website using the v3 of your theme, maybe you could run it on the testing tool I linked to you, in order to compare the behavior with the same user agent ?

    bdbrown

    (@bdbrown)

    I have a test site running v3.1.2 which worked on the testing tool you linked without any problems. It also worked without any problems (including the iPad Mini) on the other two sites I linked.

    Thread Starter greg

    (@gllorca)

    Then, it means it could be a problem from my code.

    Here is my sidebar2.php in my child theme (I have not changed the first sidebar)

    <div class="sidebar s2 <?php echo 's2_'.detecter_user_agent(); ?>">
    
    	<a class="sidebar-toggle" title="<?php _e('Expand Sidebar','hueman'); ?>"><i class="fa icon-sidebar-toggle"></i></a>
    
    	<div class="sidebar-content">
    
    		<?php if ( hu_is_checked('sidebar-top') ): ?>
      		<div class="sidebar-top group">
      			<p><?php _e('More','hueman'); ?></p>
      		</div>
    		<?php endif; ?>
    
    		<?php if ( hu_get_option( 'post-nav' ) == 's2') { get_template_part('parts/post-nav'); } ?>
    
    		<?php hu_print_widgets_in_location('s2');
    
    			/*$sidebar_id = 'gl_secondary';
    			if ((!is_archive()) && (!is_home()) && (get_post_meta($post->ID, 'sponsor_id', true))){
    				$sidebar_id = 'sponsor';
    			}
    			//if (get_post_meta($post->ID, 'sponsor_id', true)) { $sidebar_id = 'sponsor'; }
    			elseif (is_author()){
    				$sp_aut = $wpdb->get_results( 'SELECT author_id FROM wp_sponsor');
    				$author = get_user_by( 'slug', get_query_var( 'author_name' ) );
    				foreach ( $sp_aut as $sa )
    				{
    					if ($sa->author_id==$author->ID) { $sidebar_id = 'sponsor'; }
    				}
    			}
    			elseif ((is_single())||(is_category())){
    				$sidebar_id = 'single_right';
    			}
    				dynamic_sidebar( $sidebar_id ); */
    		?>
    
    	</div><!--/.sidebar-content-->
    
    </div><!--/.sidebar-->

    As you can see, I added a function that returns the user agent on the sidebar root div.

    I also added the function to dynamically select a sidebar that I had to comment out once I updated the theme.

    What could cause the issue ?

    How can I dynamically select a sidebar ?

    Thank you for your help.

    bdbrown

    (@bdbrown)

    I don’t know that it will make any difference but, if you haven’t upgraded today, you might install v3.1.3.

    function that returns the user agent

    Not sure what styles you’re applying to that in your CSS. I don’t know if that’s the problem but I found this article interesting:
    https://developer.mozilla.org/en-US/docs/Browser_detection_using_the_user_agent

    I would think that if your method of calling the dynamic sidebar worked previously then it should still work in the new version. I added one to a test site that I have and it worked without any problems.

    Thread Starter greg

    (@gllorca)

    I updated the theme to the latest version, but the problem is still there:
    http://flexible.gs/responsive-test/?url=http://blog.defi-ecologique.com&col=md

    In my functions.php file, I have the following functions, maybe one of them creates the conflict ?
    Note : I put […] in some places otherwise my message was too long

    function register_GL_sidebars() {
    	register_sidebar([...]);
    }
    add_action( 'widgets_init', 'register_GL_sidebars' );
    function remove_cssjs_ver( $src ) {
        if( strpos( $src, '?ver=' ) )
            $src = remove_query_arg( 'ver', $src );
        return $src;
    }
    add_filter( 'style_loader_src', 'remove_cssjs_ver', 10, 2 );
    add_filter( 'script_loader_src', 'remove_cssjs_ver', 10, 2 );
    // Restrict scripts and styles
    function conditionally_load_plugin_js(){
    	if( is_page() || is_archive() || is_home() ) {
    		wp_dequeue_script('wpdiscuz-validator-js');
    		wp_deregister_script('wpdiscuz-validator-js');
    		wp_dequeue_script('wpdiscuz-cookie-js');
    		wp_deregister_script('wpdiscuz-cookie-js');
    		wp_dequeue_script('wpdiscuz-tooltipster-js');
    		wp_deregister_script('wpdiscuz-tooltipster-js');
    		wp_dequeue_script('wpdiscuz-ajax-js');
    		wp_deregister_script('wpdiscuz-ajax-js');
    		wp_dequeue_script('autogrowtextarea-js');
    		wp_deregister_script('autogrowtextarea-js');
    		wp_dequeue_script('comment-reply');
    		wp_deregister_script('comment-reply');
    	}
    
    	if ( is_page() ){
    		wp_dequeue_script('opanda-lockers');
    		wp_deregister_script('opanda-lockers');
    	}
    
    	if( !is_page( array(294) ) ){
    		wp_dequeue_script('charts-js');
    		wp_deregister_script('charts-js');
    		wp_dequeue_script('wp-chart-functions');
    		wp_deregister_script('wp-chart-functions');
    	}
    
    	if( !is_page( array(293) ) ){
    		wp_dequeue_script('peekaboo_plugin');
    		wp_deregister_script('peekaboo_plugin');
    	}
    
    	if( !is_page( array(286) ) ){
    		wp_dequeue_script('jquery.tinycarousel.min');
    		wp_deregister_script('jquery.tinycarousel.min');
    	}	
    
    	if( !is_page( array(288,283,1066,285,293) ) ){
    		wp_dequeue_script('contact-form-7');
    		wp_deregister_script('contact-form-7');
    		wp_dequeue_script('jquery-form');
    		wp_deregister_script('jquery-form');
    	}
    }
    add_action( 'wp_print_scripts', 'conditionally_load_plugin_js' );
    function conditionally_load_plugin_css(){
    	[... same as above]
    }
    add_action( 'wp_print_styles', 'conditionally_load_plugin_css' );

    Regarding the right sidebar, you were right, it still works.
    Actually, I had removed it because I thought it was the cause of the other issue.

    Thank you for your help, I hope we’ll manage to solve this out !

    bdbrown

    (@bdbrown)

    I’m afraid I’m going to have to bow out at this point. I don’t have a similar device to test on and don’t know anything about Android OS. There may be someone else on the forum here that has the capability to troubleshoot this. Or, you might post your question on the WP How-To and Troubleshooting forum:
    https://ww.wp.xz.cn/support/forum/how-to-and-troubleshooting
    I apologize that I can’t do anything more to help resolve the issue.

    Thread Starter greg

    (@gllorca)

    I understand, it is goddam odd issue…
    Thank you for trying though !

    Thread Starter greg

    (@gllorca)

    Dear bdbrown,

    Actually, someone helped my identify the source of the issue on the general thread :
    https://ww.wp.xz.cn/support/topic/problem-with-sidebars-2?replies=3#post-8370370

    When I test my theme on the test tool, indeed I have the “style” tag and you don’t, which is really odd.

    Also, it is not present on the s2 sidebar, which does not make sense to me.

    Do you know where it comes from ?

    How may I remove it ?

    I added this in my CSS but I doubt it is a “clean” solution (although it works).
    @media only screen and (max-width: 960px) and (min-width: 480px){
    .s1 {
    width: 50px !important;
    }
    }

Viewing 15 replies - 1 through 15 (of 17 total)

The topic ‘Problem with sidebars since last update’ is closed to new replies.