• Resolved Martin

    (@pc-coholic)


    Hi Anders,

    I would like to propose a small change: Currently, when you remove all widgets from a block (Footer A/B/C, Sidebar), your theme will display some sample-widgets.

    So the only way to actually get an empty footer would be to add an empty textbox-widget to every footer-block.

    What do you think about removing this automatically displayed blocks? Or could you make it an option for the theme, wether to show those sample-widgets or not?

    Martin

Viewing 2 replies - 1 through 2 (of 2 total)
  • bravokeyl

    (@bravokeyl)

    Create a child theme

    and paste the following code in footer.php of child theme

    <?php if( is_active_sidebar('footer-a') || is_active_sidebar('footer-b') || is_active_sidebar('footer-c') ) : ?>
    <div class="footer section large-padding bg-dark">
    
    		<div class="footer-inner section-inner">
    
    			<?php if ( is_active_sidebar( 'footer-a' ) ) : ?>
    
    				<div class="column column-1 left">
    
    					<div class="widgets">
    
    						<?php dynamic_sidebar( 'footer-a' ); ?>
    
    					</div>
    
    				</div>
    
    			<?php endif; ?> <!-- /footer-a -->
    
    			<?php if ( is_active_sidebar( 'footer-b' ) ) : ?>
    
    				<div class="column column-2 left">
    
    					<div class="widgets">
    
    						<?php dynamic_sidebar( 'footer-b' ); ?>
    
    					</div> <!-- /widgets -->
    
    				</div>
    
    			<?php endif; ?> <!-- /footer-b -->
    
    			<?php if ( is_active_sidebar( 'footer-c' ) ) : ?>
    
    				<div class="column column-3 left">
    
    					<div class="widgets">
    
    						<?php dynamic_sidebar( 'footer-c' ); ?>
    
    					</div> <!-- /widgets -->
    
    				</div>
    
    			<?php endif; ?> <!-- /footer-c -->
    
    			<div class="clear"></div>
    
    		</div> <!-- /footer-inner -->
    
    	</div> <!-- /footer -->
    <?php endif; ?>
    	<div class="credits section bg-dark no-padding">
    
    		<div class="credits-inner section-inner">
    
    			<p class="credits-left">
    
    				? <?php echo date("Y") ?> <a href="<?php echo home_url(); ?>" title="<?php bloginfo('name'); ?>"><?php bloginfo('name'); ?></a>
    
    			</p>
    
    			<p class="credits-right">
    
    				<span><?php printf( __( 'Theme by <a href="%s">Anders Noren</a>', 'hemingway'), 'https://www.andersnoren.se' ); ?></span> — <a title="<?php _e('To the top', 'hemingway'); ?>" class="tothetop"><?php _e('Up', 'hemingway' ); ?> ↑</a>
    
    			</p>
    
    			<div class="clear"></div>
    
    		</div> <!-- /credits-inner -->
    
    	</div> <!-- /credits -->
    
    </div> <!-- /big-wrapper -->
    
    <?php wp_footer(); ?>
    
    </body>
    </html>

    What it does is checks whether any of the footer widget areas are active by using is_active_sidebar() function and then display footer area accordingly ..

    Thread Starter Martin

    (@pc-coholic)

    Hi bravokeyl,

    thanks for this suggesstion, too ??

    Martin

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Do not show content in empty widgets’ is closed to new replies.