<?php

use TotalTheme\Topbar\Core as Topbar;

/**
 * Topbar content.
 *
 * @package TotalTheme
 * @subpackage Partials
 * @version 6.6
 */

defined( 'ABSPATH' ) || exit;

if ( ! class_exists( 'TotalTheme\Topbar\Core' ) ) {
	return;
}

$content = Topbar::get_content();

if ( $content || has_nav_menu( 'topbar_menu' ) ) : ?>

	<div id="top-bar-content" <?php Topbar::content_class(); ?>><?php

		// Menu
		get_template_part( 'partials/topbar/topbar-menu' );

		// Content
		if ( $content ) {
			if ( WPEX_VC_ACTIVE ) {
				$template_id = Topbar::get_template_id();
				if ( $template_id ) {
					$wpb_style = totaltheme_get_instance_of( 'TotalTheme\Integration\WPBakery\Shortcode_Inline_Style' );
					if ( $wpb_style ) {
						$wpb_style->render_style( $template_id );
					}
				}
			}
			echo do_shortcode( totaltheme_replace_vars( wp_kses_post( $content ) ) );
		}

	?></div>

<?php
endif;
