WordPress.org

Support

Support » How-To and Troubleshooting » [Resolved] Dynamic sidebar not working on remote site

[Resolved] Dynamic sidebar not working on remote site

  • My dynamic sidebar is not appearing after uploading the local site to remote server and childtheme is not overriding parent styles in content area. I uploaded the site using xml file with the wordpress plugin.

    After uploading the site to the remote server, I checked the settings and function.php and sidebar.php between local and remote and everything matches.

    I switched all instances of localhost to url and I see that my childtheme is activate and styles are linked.

    The one difference is in local site says I am using 4 widgets and remote says I am using two widgets. Don’t know if this is the problem.

    Link to blog. http://saltworksgallery.com/blog/

    Thank you,
    Brian

Viewing 9 replies - 1 through 9 (of 9 total)
  • The sidebar is not being called. It works on my local server but not on remote server. Everything else works but the secondary div is not appearing in page… Is the site not recognizing active widgets?

    The call for sidebar from the page template.

    <?php get_sidebar( 'page'); ?>

    The sidebar-page code:

    <?php
    /**
     * The sidebar containing the main widget area.
     *
     * If no active widgets in sidebar, let's hide it completely.
     *
     * @package WordPress
     * @subpackage Twenty_Twelve
     * @since Twenty Twelve 1.0
     */
    ?>
    
    	<?php if ( is_active_sidebar( 'sidebar-4' ) ) : ?>
    		<div id="secondary" class="widget-area" role="complementary">
    			<?php dynamic_sidebar( 'sidebar-4' ); ?>
    		</div><!-- #secondary -->
    	<?php endif; ?>

    Here is the function calling ‘sidebar-4’

    function mychildtheme_setup() {
    
    	// This theme uses wp_nav_menu() in one location.
    	register_nav_menu( 'secondary', __( 'Footer Menu', 'twentytwelve' ) );
    
    	// New widgetized sidebar area for pages
    	register_sidebar( array(
    		'name' => __( 'Page Sidebar', 'twentytwelve' ),
    		'id' => 'sidebar-4',
    		'description' => __( 'Appears on pages only', 'twentytwelve' ),
    		'before_widget' => '<aside id="%1$s" class="widget %2$s">',
    		'after_widget' => '</aside>',
    		'before_title' => '<h3 class="widget-title">',
    		'after_title' => '</h3>',
    	) );
    }
    
    add_action( 'after_setup_theme', 'mychildtheme_setup', 11 );

    esmi

    @esmi

    Forum Moderator

    Try checking your site’s error logs for error messages. Your hosts should be able to help you in accessing your site’s error logs.

    Thanks Esmi,

    I checked my site’s error log and all I see is a link to a favicon error for today.

    [Fri May 03 11:09:36 2013] [error] File does not exist: /usr/local/www/vhosts/saltworksgallery.com/htdocs/blog/wp-content/themes/saltworksChildTheme/favicon.ico/><link rel=

    I tried enabling WP_DEBUG but nothing is showing up wp_content directory.

    I install the wordpress plugin debug this and ran wp_debug.
    No errors were log. Very confused in what to look for.

    esmi

    @esmi

    Forum Moderator

    What happens if you use the original parent theme?

    A default sidebar appears with activated widgets.

    With the child theme I am using a static widget that appears above any dynamic widgets.

    The code for sidebar.php.

    <?php
    /**
     * The sidebar containing the main widget area.
     *
     * If no active widgets in sidebar, let's hide it completely.
     *
     * @package WordPress
     * @subpackage Twenty_Twelve
     * @since Twenty Twelve 1.0
     */
    ?>
    
    	<?php if ( is_active_sidebar( 'sidebar-1' ) ) : ?>
    		<div id="secondary" class="widget-area" role="complementary">
    
            	<aside id="social-icons" class="widget-clear">
                 	<h3 class="widget-title">Follow SALTWORKS</h3>
                    <ul>
                    	<li class="social-twitter">
                        	<a title="Follow Saltworks on Twitter" href="https://twitter.com/SALTWORKS" target="_blank">Twitter</a>
                        </li>
                        <li class="social-facebook">
                        	<a title="Follow Saltworks on Facebook" href="http://www.facebook.com/pages/Atlanta-GA/SALTWORKS-Contemporary-Art/40633780886?v=wall" target="_blank" >Facebook</a>
                        </li>
                        <li class="social-pinterest">
                        	<a title="Follow Saltworks on Pinterest" href="http://pinterest.com/saltworksart/" target="_blank" >Pinterest</a>
                        </li>
    
    			<?php dynamic_sidebar( 'sidebar-1' ); ?>
    		</div><!-- #secondary -->
    	<?php endif; ?>

    Could the problem be linked to permissions? I did have some struggle in uploading local site to remote server due to permissions.

    I solved the problem by switching to a new host with cpanel and uploading the database via phpmyadmin. The previous upload using the xml wordpress importer was the cause of problem.

Viewing 9 replies - 1 through 9 (of 9 total)
  • The topic ‘[Resolved] Dynamic sidebar not working on remote site’ is closed to new replies.
Skip to toolbar