<?php
/**
 * The Sidebar containing the main widget areas.
 * @package Pr Agency
 */
?>
<div id="sidebar">    
    <?php if ( ! dynamic_sidebar( 'pr-agency-sidebar-1' ) ) : ?>
        <aside role="complementary" aria-label="pr-agency-sidebar-1" id="archives" class="widget">
            <h3 class="widget-title"><?php esc_html_e( 'Archives', 'pr-agency' ); ?></h3>
            <ul>
                <?php wp_get_archives( array( 'type' => 'monthly' ) ); ?>
            </ul>
        </aside>
        <aside role="complementary" aria-label="pr-agency-sidebar-2" id="meta" class="widget">
            <h3 class="widget-title"><?php esc_html_e( 'Meta', 'pr-agency' ); ?></h3>
            <ul>
                <?php if ( ! is_user_logged_in() && get_option( 'users_can_register' ) ) : ?>
                    <li><a href="<?php echo esc_url( wp_registration_url() ); ?>"><?php esc_html_e( 'Register', 'pr-agency' ); ?></a></li>
                <?php endif; ?>
                <li><?php wp_loginout(); ?></li>
                <?php wp_meta(); ?>
            </ul>
        </aside>
    <?php endif; // end sidebar widget area ?>  
</div>