0

I have 6 widgets in Wordpress. Three works correct, but three display nothing. Code of one which is not working is:

register_sidebar(array(
        'name' => __('Title Footer Menu Third'),
        'id'   => 'sidebar-title-c',
        'before_widget' => '',
        'after_widget'  => '',
        'before_title'  => '',
        'after_title'   => ''
    ));

I try to display this into footer.php just like that:

<p style="font-size: 12px;margin-top:-4px;font-weight: 900;color: #fff;border-bottom: solid 1px #02B4EA;padding-bottom: 5px;"><?php if ( !function_exists('dynamic_sidebar') || !dynamic_sidebar("sidebar-title-c") ) :  ?>
<?php endif;?></p>

Why is not working for all six widgets?

2
  • do you see all six corresponding widget areas in the dashboard under 'Appearance' - 'Widgets'? and did you add at least one widget into each of the areas?
    – Michael
    Commented Mar 19, 2020 at 14:48
  • 1
    When you say widget, do you mean a widget in a sidebar, or do you mean a sidebar itself? It looks like you've muddled up sidebars and widgets, or at least I think you have, it makes the question confusing
    – Tom J Nowell
    Commented Mar 19, 2020 at 15:09

1 Answer 1

0

Your if statement is empty. Also I don't think your if statement is correct. Can you try this:

<?php if ( is_active_sidebar( 'sidebar-title-c' ) ) : ?>
    <p style="font-size: 12px;margin-top:-4px;font-weight: 900;color: #fff;border-bottom: solid 1px #02B4EA;padding-bottom: 5px;">
        <?php dynamic_sidebar( 'sidebar-title-c' ); ?>
    </p>
<?php endif; ?>

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.