<?php
/**
 *  functions and definitions.
 *
 * @link https://developer.wordpress.org/themes/basics/theme-functions/
 *
 * * @package luzuk Premium
 */
$query='';

// //  header text color ,background color option remove
function remove_customizer_colors( $wp_customize ) {
 
    // Remove controls ONLY (safe)
    $wp_customize->remove_control( 'background_color' );
    $wp_customize->remove_control( 'header_textcolor' );
 
}
add_action( 'customize_register', 'remove_customizer_colors', 100 );

define('FS_METHOD', 'direct');
if ( ! function_exists( 'luzuk_lite_setup' ) ) :
    /**
     * Sets up theme defaults and registers support for various WordPress features.
     *
     * Note that this function is hooked into the after_setup_theme hook, which
     * runs before the init hook. The init hook is too late for some features, such
     * as indicating support for post thumbnails.
     */
    
    function luzuk_lite_setup() {
    	define( 'MTS_THEME_VERSION', '2.0.6' );
        /*
    	 * Make theme available for translation.
    	 * Translations can be filed in the /languages/ directory.
    	 * If you're building a theme based on publishable, use a find and replace
    	 * to change 'luzuk Premium' to the name of your theme in all the template files.
    	 */
        load_theme_textdomain( 'luzuk Premium', get_template_directory() . '/languages' );

    	// Add default posts and comments RSS feed links to head.
        add_theme_support( 'automatic-feed-links' );

    	/*
    	 * Let WordPress manage the document title.
    	 * By adding theme support, we declare that this theme does not use a
    	 * hard-coded <title> tag in the document head, and expect WordPress to
    	 * provide it for us.
    	 */
    	add_theme_support( 'title-tag' );

    	/*
    	 * Enable support for Post Thumbnails on posts and pages.
    	 *
    	 * @link https://developer.wordpress.org/themes/functionality/featured-images-post-thumbnails/
    	 */
    	add_theme_support( 'post-thumbnails' );
    	set_post_thumbnail_size( 150, 150, true );
    	add_image_size( 'luzuk Premium-related', 200, 125, true ); //related

    	// This theme uses wp_nav_menu() in one location.
    	register_nav_menus( array(
    		'primary' => esc_html__( 'My Custom Menu', 'luzuk Premium' ),
    	) );

    	/*
    	 * Switch default core markup for search form, comment form, and comments
    	 * to output valid HTML5.
    	 */
    	add_theme_support( 'html5', array(
    		'comment-form',
    		'comment-list',
    		'gallery',
    		'caption',
    	) );

        if ( luzuk_lite_is_wc_active() ) {
            add_theme_support( 'woocommerce' );
        }
        
    	// Set up the WordPress core custom background feature.
        add_theme_support( 'custom-background', apply_filters( 'luzuk_lite_custom_background_args', array(
          'default-color' => '#000',
          'default-image' => '',
      ) ) );
    }
endif;
add_action( 'after_setup_theme', 'luzuk_lite_setup' );

function luzuk_lite_content_width() {
	$GLOBALS['content_width'] = apply_filters( 'luzuk_lite_content_width', 678 );
}
add_action( 'after_setup_theme', 'luzuk_lite_content_width', 0 );

/**
 * Register widget area.
 *
 * @link https://developer.wordpress.org/themes/functionality/sidebars/#registering-a-sidebar
 */
function luzuk_lite_widgets_init() {
	register_sidebar( array(
		'name'          => esc_html__( 'Sidebar', 'luzuk Premium' ),
		'id'            => 'sidebar',
		'description'   => '',
		'before_widget' => '<div id="%1$s" class="widget %2$s  wow bounceInUp">',
		'after_widget'  => '</div>',
		'before_title'  => '<h4 class="widget-title">',
		'after_title'   => '</h4>',
	) );

	/*// Header Ad sidebar
    register_sidebar(array(
        'name' => __('Header Ad', 'luzuk Premium'),
        'description'   => __( '728x90 Ad Area', 'luzuk Premium' ),
        'id' => 'widget-header',
        'before_widget' => '<div id="%1$s" class="widget-header">',
        'after_widget' => '</div>',
        'before_title' => '<h3 class="widget-title">',
        'after_title' => '</h3>',
    ));*/

    // single post side bar
    register_sidebar( array(
        'name'          => esc_html__( 'Single Post Sidebar', 'Luzuk Premium' ),
        'id'            => 'luzuk-single-post-sidebar',
        'description'   => __( 'Add widgets here to appear in your sidebar of service page.', 'Luzuk Premium' ),
        'before_widget' => '<aside id="%1$s" class="widget %2$s wow bounceInUp">',
        'after_widget'  => '</aside>',
        'before_title'  => '<h4 class="widget-title">',
        'after_title'   => '</h4>',
    ) );

    
    // Service side bar
    register_sidebar( array(
        'name'          => esc_html__( 'Service Sidebar', 'Luzuk Premium' ),
        'id'            => 'luzuk-service-sidebar',
        'description'   => __( 'Add widgets here to appear in your sidebar of service page.', 'Luzuk Premium' ),
        'before_widget' => '<aside id="%1$s" class="widget %2$s wow bounceInUp">',
        'after_widget'  => '</aside>',
        'before_title'  => '<h4 class="widget-title">',
        'after_title'   => '</h4>',
    ) );

    // // Project side bar
    // register_sidebar( array(
    //     'name'          => esc_html__( 'Project Sidebar', 'Luzuk Premium' ),
    //     'id'            => 'luzuk-project-sidebar',
    //     'description'   => __( 'Add widgets here to appear in your sidebar of project page.', 'Luzuk Premium' ),
    //     'before_widget' => '<aside id="%1$s" class="widget %2$s wow bounceInUp">',
    //     'after_widget'  => '</aside>',
    //     'before_title'  => '<h4 class="widget-title">',
    //     'after_title'   => '</h4>',
    // ) );

    // // Events side bar
    // register_sidebar( array(
    //     'name'          => esc_html__( 'Events Sidebar', 'Luzuk Premium' ),
    //     'id'            => 'luzuk-events-sidebar',
    //     'description'   => __( 'Add widgets here to appear in your sidebar of events page.', 'Luzuk Premium' ),
    //     'before_widget' => '<aside id="%1$s" class="widget %2$s wow bounceInUp">',
    //     'after_widget'  => '</aside>',
    //     'before_title'  => '<h4 class="widget-title">',
    //     'after_title'   => '</h4>',
    // ) );

    // // Courses side bar
    // register_sidebar( array(
    //     'name'          => esc_html__( 'Courses Sidebar', 'Luzuk Premium' ),
    //     'id'            => 'luzuk-courses-sidebar',
    //     'description'   => __( 'Add widgets here to appear in your sidebar of courses page.', 'Luzuk Premium' ),
    //     'before_widget' => '<aside id="%1$s" class="widget %2$s wow bounceInUp">',
    //     'after_widget'  => '</aside>',
    //     'before_title'  => '<h4 class="widget-title">',
    //     'after_title'   => '</h4>',
    // ) );

    // Shop side bar
    register_sidebar( array(
        'name'          => esc_html__( 'Shop Sidebar', 'luzuk Premium' ),
        'id'            => 'luzuk-shop-sidebar',
        'description'   => __( 'Add widgets here to appear in your sidebar of shop page.', 'luzuk Premium' ),
        'before_widget' => '<aside id="%1$s" class="widget %2$s wow bounceInUp">',
        'after_widget'  => '</aside>',
        'before_title'  => '<h4 class="widget-title">',
        'after_title'   => '</h4>',
    ) );
    // Blog side bar
    register_sidebar( array(
        'name'          => esc_html__( 'Blog Sidebar', 'luzuk Premium' ),
        'id'            => 'luzuk-blog-sidebar',
        'description'   => __( 'Add widgets here to appear in your sidebar of blog page.', 'luzuk Premium' ),
        'before_widget' => '<aside id="%1$s" class="widget %2$s  wow bounceInUp">',
        'after_widget'  => '</aside>',
        'before_title'  => '<h4 class="widget-title">',
        'after_title'   => '</h4>',
    ) );
    // // FOOTER ONE WIDGET SIDEBAR
    // register_sidebar( array(
    //     'name'          => esc_html__( 'Footer One', 'luzuk Premium' ),
    //     'id'            => 'luzuk-footer1',
    //     'description'   => __( 'Add widgets here to appear in your Footer.', 'luzuk Premium' ),
    //     'before_widget' => '<aside id="%1$s" class="widget %2$s">',
    //     'after_widget'  => '</aside>',
    //     'before_title'  => '<h4 class="widget-title">',
    //     'after_title'   => '</h4>',
    // ) );
    // // FOOTER TWO WIDGET SIDEBAR
    // register_sidebar( array(
    //     'name'          => esc_html__( 'Footer Two', 'luzuk Premium' ),
    //     'id'            => 'luzuk-footer2',
    //     'description'   => __( 'Add widgets here to appear in your Footer.', 'luzuk Premium' ),
    //     'before_widget' => '<aside id="%1$s" class="widget %2$s">',
    //     'after_widget'  => '</aside>',
    //     'before_title'  => '<h4 class="widget-title">',
    //     'after_title'   => '</h4>',
    // ) );
    // // FOOTER THREE WIDGET SIDEBAR
    // register_sidebar( array(
    //     'name'          => esc_html__( 'Footer Three', 'luzuk Premium' ),
    //     'id'            => 'luzuk-footer3',
    //     'description'   => __( 'Add widgets here to appear in your Footer.', 'luzuk Premium' ),
    //     'before_widget' => '<aside id="%1$s" class="widget %2$s">',
    //     'after_widget'  => '</aside>',
    //     'before_title'  => '<h4 class="widget-title">',
    //     'after_title'   => '</h4>',
    // ) );
    // // FOOTER FOUR WIDGET SIDEBAR
    // register_sidebar( array(
    //     'name'          => esc_html__( 'Footer Four', 'luzuk Premium' ),
    //     'id'            => 'luzuk-footer4',
    //     'description'   => __( 'Add widgets here to appear in your Footer.', 'luzuk Premium' ),
    //     'before_widget' => '<aside id="%1$s" class="widget %2$s">',
    //     'after_widget'  => '</aside>',
    //     'before_title'  => '<h4 class="widget-title">',
    //     'after_title'   => '</h4>',
    // ) );
    // // FOOTER FIVE WIDGET SIDEBAR
    // register_sidebar( array(
    //     'name'          => esc_html__( 'Footer Five', 'luzuk Premium' ),
    //     'id'            => 'luzuk-footer5',
    //     'description'   => __( 'Add widgets here to appear in your Footer.', 'luzuk Premium' ),
    //     'before_widget' => '<aside id="%1$s" class="widget %2$s">',
    //     'after_widget'  => '</aside>',
    //     'before_title'  => '<h4 class="widget-title">',
    //     'after_title'   => '</h4>',
    // ) );
    // // FOOTER SIX WIDGET SIDEBAR
    // register_sidebar( array(
    //     'name'          => esc_html__( 'Footer Six', 'luzuk Premium' ),
    //     'id'            => 'luzuk-footer6',
    //     'description'   => __( 'Add widgets here to appear in your Footer.', 'luzuk Premium' ),
    //     'before_widget' => '<aside id="%1$s" class="widget %2$s">',
    //     'after_widget'  => '</aside>',
    //     'before_title'  => '<h4 class="widget-title">',
    //     'after_title'   => '</h4>',
    // ) );

// =================

    // if ( luzuk_lite_is_wc_active() ) {
    //     // Register WooCommerce Shop and Single Product Sidebar
    //     register_sidebar( array(
    //         'name' => __('Shop Page Sidebar', 'luzuk Premium' ),
    //         'description'   => __( 'Appears on Shop main page and product archive pages.', 'luzuk Premium' ),
    //         'id' => 'shop-sidebar',
    //         'before_widget' => '<div id="%1$s" class="widget %2$s">',
    //         'after_widget' => '</div>',
    //         'before_title' => '<h4 class="widget-title">',
    //         'after_title' => '</h4>',
    //     ) );
    //     register_sidebar( array(
    //         'name' => __('Single Product Sidebar', 'luzuk Premium' ),
    //         'description'   => __( 'Appears on single product pages.', 'luzuk Premium' ),
    //         'id' => 'product-sidebar',
    //         'before_widget' => '<div id="%1$s" class="widget %2$s">',
    //         'after_widget' => '</div>',
    //         'before_title' => '<h4 class="widget-title">',
    //         'after_title' => '</h4>',
    //     ) );
    // }
}
add_action( 'widgets_init', 'luzuk_lite_widgets_init' );

function luzuk_lite_custom_sidebar() {
    // Default sidebar.
    $sidebar = 'sidebar';

    // Woocommerce.
    if ( luzuk_lite_is_wc_active() ) {
        if ( is_shop() || is_product_category() ) {
            $sidebar = 'shop-sidebar';
        }
        if ( is_product() ) {
            $sidebar = 'product-sidebar';
        }
    }

    return $sidebar;
}

/**
 * Enqueue scripts and styles.
 */
function luzuk_lite_scripts() {
    wp_enqueue_style( 'luzuk Premium-style', get_stylesheet_uri() );

    $handle = 'luzuk Premium-style';

    // WooCommerce
    if ( luzuk_lite_is_wc_active() ) {
        if ( is_woocommerce() || is_cart() || is_checkout() ) {
            wp_enqueue_style( 'woocommerce', get_template_directory_uri() . '/css/woocommerce2.css' );
            $handle = 'woocommerce';
        }
    }
    //wp_enqueue_script( 'flickity-pkgd', get_template_directory_uri() . '/js/flickity.pkgd.min.js', array('jquery'), '20160903', true );

    //wp_enqueue_script( 'jquery-bxslider-min', get_template_directory_uri() . '/js/jquery.bxslider.min.js', array('jquery'), '4.1.2', true );

    //wp_enqueue_script( 'jquery-bxslider', get_template_directory_uri() . '/js/jquery.bxslider.js', array('jquery'), '4.1.2', true );
    //wp_enqueue_script( 'smoothscroll', get_template_directory_uri() . '/js/SmoothScroll.js', array(), '20160809', false );
    wp_enqueue_script( 'jquery-nav', get_template_directory_uri() . '/js/jquery.nav.js', array('jquery'), '20160903', true );
    wp_enqueue_script( 'isotope-pkgd', get_template_directory_uri() . '/js/isotope.pkgd.js', array('jquery', 'imagesloaded' ), '20150903', true );
    wp_enqueue_script( 'nivo-lightbox', get_template_directory_uri() . '/js/nivo-lightbox.js', array('jquery'), '20150903', true );
    wp_enqueue_script( 'superfish', get_template_directory_uri() . '/js/superfish.js', array('jquery'), '20150903', true );
    wp_enqueue_script( 'jquery-stellar', get_template_directory_uri() . '/js/jquery.stellar.js', array('imagesloaded'), '20150903', false ); 
    wp_enqueue_script( 'wow', get_template_directory_uri() . '/js/wow.js', array('jquery'), '20150903', true );
    wp_enqueue_script( 'odometer', get_template_directory_uri() . '/js/odometer.js', array('jquery'), '20150903', true );
    wp_enqueue_script( 'waypoint', get_template_directory_uri() . '/js/waypoint.js', array('jquery'), '20150903', true );
    wp_enqueue_script( 'total-custom', get_template_directory_uri() . '/js/total-custom.js', array('jquery'), '20150903', true );
    wp_localize_script( 'total-custom', 'total_localize', array('template_path' => get_template_directory_uri() ));
    wp_enqueue_script( 'owl-carousel', get_template_directory_uri() . '/js/owl.carousel.js', array('jquery'), '1.3.3', true );
    wp_enqueue_script( 'fancybox.umd', get_template_directory_uri() . '/js/fancybox.umd.js', array('jquery'), '20150903', true );
    wp_enqueue_script( 'main', get_template_directory_uri() . '/js/main.js', array('jquery'), '20150903', true );
    wp_enqueue_script( 'navigation', get_template_directory_uri() . '/js/navigation.js', array('jquery'), '20150903', true );

    //wp_enqueue_script('slider', get_template_directory_uri().'/js/slider.js', array(), '1.1', true);
    //wp_enqueue_script('jquery-3-3-1-min', get_template_directory_uri().'/js/jquery-3.3.1.min.js', array(), '1.1', true);
    //  wp_enqueue_script( 'jquery-3-1-1-slim-min', get_template_directory_uri() . '/js/jquery-3.1.1.slim.min.js', array('jquery'), '20150903', true );
  

//css

    wp_enqueue_style( 'style-min', get_template_directory_uri() . '/css/style.min.css', array(), '1.3.3' );
    wp_enqueue_style( 'fancybox', get_template_directory_uri() . '/css/fancybox.css', array(), '1.3.3' );
    wp_enqueue_style( 'animate', get_template_directory_uri() . '/css/animate.css', array(), '1.0' );
    wp_enqueue_style( 'font-awesome', get_template_directory_uri() . '/css/font-awesome.css', array(), '4.4.0' );
    wp_enqueue_style( 'owl-carousel', get_template_directory_uri() . '/css/owl.carousel.css', array(), '1.3.3' );
    wp_enqueue_style( 'owl-theme', get_template_directory_uri() . '/css/owl.theme.css', array(), '1.3.3' );
    wp_enqueue_style( 'owl-carousel-min', get_template_directory_uri() . '/css/owl.carousel.min.css', array(), '1.3.3' );
    wp_enqueue_style( 'owl-theme-default-min', get_template_directory_uri() . '/css/owl.theme.default.min.css', array(), '1.3.3' );
    wp_enqueue_style( 'nivo-lightbox', get_template_directory_uri() . '/css/nivo-lightbox.css', array(), '1.3.3' );
    wp_enqueue_style( 'superfish', get_template_directory_uri() . '/css/superfish.css', array(), '1.3.3' );
    wp_enqueue_style( 'style-min', get_template_directory_uri() . '/css/style.min.css', array(), '1.3.3' );
    wp_enqueue_style( 'templete', get_template_directory_uri() . '/css-new/templete.css', array(), '1.3.3' );
    //wp_enqueue_style( 'swiper-min', get_template_directory_uri() . '/css/swiper.min.css', array(), '1.3.3' );
    // wp_enqueue_style( 'bxslider', get_template_directory_uri() . '/css/jquery.bxslider.css', array(), '4.1.2' );


//google fonts
    wp_enqueue_style( 'google-fonts', 'https://fonts.googleapis.com/css?family=Archivo+Narrow|Arimo|Berkshire+Swash|Bitter|Comfortaa|Dancing+Script|Dosis|Droid+Serif|Francois+One|Germania+One|Hammersmith+One|Indie+Flower|Lobster|Muli|Nosifer|PT+Sans|PT+Sans+Caption|PT+Sans+Narrow|Pacifico|Questrial|Roboto+Mono|Roboto+Slab|Source+Serif+Pro|Titillium+Web|Work+Sans|Rubik:700i' );
    // wp_add_inline_style( 'total-style', total_dymanic_styles() );

    wp_enqueue_script( 'luzuk Premium-customscripts', get_template_directory_uri() . '/js/customscripts.js',array('jquery'),'',true);

    if ( is_singular() && comments_open() && get_option( 'thread_comments' ) ) {
      wp_enqueue_script( 'comment-reply' );
  }

  $luzuk_lite_color_scheme = get_theme_mod('luzuk_template_color', '#fe5722');
  $luzuk_lite_color_scheme2 = get_theme_mod('luzuk_template_color2', '#44afdd');
  //$header = get_theme_mod('header_textcolor', '#000');
  $luzuk_lite_layout = get_theme_mod('luzuk_lite_layout', 'cslayout');

  $custom_css = total_dymanic_styles();
  wp_add_inline_style( $handle, $custom_css );
}
add_action( 'wp_enqueue_scripts', 'luzuk_lite_scripts' );
/**
 * Implement the Custom Header feature.
 */
require get_template_directory() . '/inc/custom-header.php';

/**
 * Implement the Custom Header feature.
 */
require get_template_directory() . '/inc/style.php';
/**
 * Custom template tags for this theme.
 */
require get_template_directory() . '/inc/template-tags.php';


/**
 * Customizer additions.
 */
require get_template_directory() . '/inc/lz-customizer.php';

/**
 * Custom functions that act independently of the theme templates.
 */
require get_template_directory() . '/inc/lz-customizer-functions.php';
/**
 * Load Jetpack compatibility file.
 */
require get_template_directory() . '/inc/jetpack.php';
/**
 * Load Font Awesome list file.
 */
require get_template_directory() . '/inc/font-awesome-list.php';
/**
 * Load function file.
 */
require get_template_directory() . '/inc/functions.php';
/**
 * Add the Social buttons Widget.
 */
include_once( "functions/widget-social.php" );
require_once('functions/meta-data.php'); // ADD THE META DETA FOR THE PHP


require get_template_directory() . '/inc/notifications.php';

require get_template_directory() . '/inc/theme-tracker.php';

/**
 * Add inline styles for remote notification banner.
 */
function luzuk_lite_notification_styles() {
    $css = '
    .luzuk-lite-remote-notification {
        background: #111;
        color: #fff;
        padding: 20px 0;
        text-align: center;
        border-bottom: 4px solid #e74c3c;
    }
    .luzuk-lite-remote-notification__inner {
        max-width: 1100px;
        margin: 0 auto;
        padding: 0 20px;
    }
    .luzuk-lite-dashboard-notification + .luzuk-lite-dashboard-notification {
        margin-top: 20px;
        border-top: 1px solid #e2e4e7;
        padding-top: 20px;
    }';

    wp_add_inline_style( 'luzuk-lite-style', $css );
}
add_action( 'wp_enqueue_scripts', 'luzuk_lite_notification_styles' );


/**
 * Copyrights
 */
if ( ! function_exists( 'luzuk_lite_copyrights_credit' ) ) {
    function luzuk_lite_copyrights_credit() { 
        global $mts_options
        ?>
        <!--start copyrights-->
        <div class="copyrights">
            <div class="container">
                <div id="copyright-note">
                    <span>Copyright <?php echo '&copy; '.date_i18n(__('Y','luzuk')); ?> <?php bloginfo( 'name' ); ?>. All Rights Reserved
                    </span>
            <!--<div class="top">
            
                <a href="#top" class="toplink"><//?php //_e('Back to Top','luzuk Premium'); ?> &uarr;</a>
            </div>-->
                </div>
            </div>
        </div>
<!--end copyrights-->
<?php }
}

/**
 * Custom Comments template
 */
if ( ! function_exists( 'luzuk_lite_comments' ) ) {
	function luzuk_lite_comment($comment, $args, $depth) { ?>
		<li <?php comment_class(); ?> id="li-comment-<?php comment_ID() ?>">
			<div id="comment-<?php comment_ID(); ?>" style="position:relative;" itemscope itemtype="http://schema.org/UserComments">
				<div class="comment-author vcard">
					<?php echo get_avatar( $comment->comment_author_email, 70 ); ?>
					<div class="comment-metadata">
                        <?php printf('<span class="fn" itemprop="creator" itemscope itemtype="http://schema.org/Person">%s</span>', get_comment_author_link()) ?>
                        <span class="comment-meta">
                          <?php edit_comment_link(__('(Edit)', 'luzuk Premium'),'  ','') ?>
                      </span>
                  </div>
              </div>
              <?php if ($comment->comment_approved == '0') : ?>
               <em><?php _e('Your comment is awaiting moderation.', 'luzuk Premium') ?></em>
               <br />
           <?php endif; ?>
           <div class="commentmetadata" itemprop="commentText">
               <?php comment_text() ?>
               <time><?php comment_date(get_option( 'date_format' )); ?></time>
               <span class="reply">
                <?php comment_reply_link(array_merge( $args, array('depth' => $depth, 'max_depth' => $args['max_depth']))) ?>
            </span>
        </div>
    </div>
</li>
<?php }
}

/*
 * Excerpt
 */
function luzuk_lite_excerpt($limit) {
  $excerpt = explode(' ', get_the_excerpt(), $limit);
  if (count($excerpt)>=$limit) {
    array_pop($excerpt);
    $excerpt = implode(" ",$excerpt);
} else {
    $excerpt = implode(" ",$excerpt);
}
$excerpt = preg_replace('`[[^]]*]`','',$excerpt);
return $excerpt;
}

/**
 * Shorthand function to check for more tag in post.
 *
 * @return bool|int
 */
function luzuk_lite_post_has_moretag() {
    return strpos( get_the_content(), '<!--more-->' );
}

if ( ! function_exists( 'luzuk_lite_readmore' ) ) {
    /**
     * Display a "read more" link.
     */
    function luzuk_lite_readmore() {
    ?>


    <?php if( get_theme_mod('blogpage_button_display','show' ) == 'show') : ?>
        <?php
            $bloginner_page_id = get_theme_mod('bloginner_page'); 
            $bloginnerbutn_text = get_theme_mod('blogbutninner_text', 'Continue Reading');
        ?>

        <a href="<?php echo esc_url( get_the_permalink() ); ?>" title="<?php the_title_attribute(); ?>" target="_blank">
            <?php echo $bloginnerbutn_text; ?>
                
        </a>

    <?php endif ?>
        
     <?php 
    }
}

/**
 * Breadcrumbs
 */
if (!function_exists('luzuk_lite_the_breadcrumb')) {
    function luzuk_lite_the_breadcrumb() {
        if ( is_front_page() ) {
            return;
        }
        echo '<span typeof="v:Breadcrumb" class="root"><a rel="v:url" property="v:title" href="';
        echo esc_url( home_url() );
        /* =====breadcrumb text====== */
        $breadcrumbhometxtbutton = get_theme_mod('luzuk_breadcrumbhometxt', 'Home'); 
        /* =====breadcrumb text====== */
        echo '">'.(sprintf( __( "$breadcrumbhometxtbutton", 'luzuk Premium' )));
        echo '</a></span><i class="fa fa-long-arrow-right"></i><span class="bread-arrow"></span>';
        if (is_single()) {
            $categories = get_the_category();
            if ( $categories ) {
                $level = 0;
                $hierarchy_arr = array();
                foreach ( $categories as $cat ) {
                    $anc = get_ancestors( $cat->term_id, 'category' );
                    $count_anc = count( $anc );
                    if (  0 < $count_anc && $level < $count_anc ) {
                        $level = $count_anc;
                        $hierarchy_arr = array_reverse( $anc );
                        array_push( $hierarchy_arr, $cat->term_id );
                    }
                }
                if ( empty( $hierarchy_arr ) ) {
                    $category = $categories[0];
                    echo '<span typeof="v:Breadcrumb"><a href="'. esc_url( get_category_link( $category->term_id ) ).'" rel="v:url" property="v:title">'.esc_html( $category->name ).'</a></span><span class="bread-arrow">
                    <i class="fa fa-long-arrow-right"></i>
                    </span>';
                } else {
                    foreach ( $hierarchy_arr as $cat_id ) {
                        $category = get_term_by( 'id', $cat_id, 'category' );
                        echo '<span typeof="v:Breadcrumb"><a href="'. esc_url( get_category_link( $category->term_id ) ).'" rel="v:url" property="v:title">'.esc_html( $category->name ).'</a></span><span class="bread-arrow"><i class="fa fa-angle-double-right
                        "></i></span>';
                    }
                }
            }
            echo "<span><span class='treeEnd'>";
            the_title();
            echo "</span></span>";
        } elseif (is_page()) {
            $parent_id  = wp_get_post_parent_id( get_the_ID() );
            if ( $parent_id ) {
                $breadcrumbs = array();
                while ( $parent_id ) {
                    $page = get_page( $parent_id );
                    $breadcrumbs[] = '<span typeof="v:Breadcrumb"><a href="'.esc_url( get_permalink( $page->ID ) ).'" rel="v:url" property="v:title">'.esc_html( get_the_title($page->ID) ). '</a></span><span>
                    <i class="fa fa-angle-double-right"></i></span>';
                    $parent_id  = $page->post_parent;
                }
                $breadcrumbs = array_reverse( $breadcrumbs );
                foreach ( $breadcrumbs as $crumb ) { echo $crumb; }
            }
            echo "<span><span class='treeEnd'>";
            the_title();
            echo "</span></span>";
        } elseif (is_category()) {
            global $wp_query;
            $cat_obj = $wp_query->get_queried_object();
            $this_cat_id = $cat_obj->term_id;
            $hierarchy_arr = get_ancestors( $this_cat_id, 'category' );
            if ( $hierarchy_arr ) {
                $hierarchy_arr = array_reverse( $hierarchy_arr );
                foreach ( $hierarchy_arr as $cat_id ) {
                    $category = get_term_by( 'id', $cat_id, 'category' );
                    echo '<span typeof="v:Breadcrumb"><a href="'.esc_url( get_category_link( $category->term_id ) ).'" rel="v:url" property="v:title">'.esc_html( $category->name ).'</a></span><span><i class="fa fa-angle-double-right
                    "></i></span>';
                }
            }
            echo "<span><span class='treeEnd'>";
            single_cat_title();
            echo "</span></span>";
        } elseif (is_author()) {
            echo "<span><span class='treeEnd'>";
            if(get_query_var('author_name')) :
                $curauth = get_user_by('slug', get_query_var('author_name'));
            else :
                $curauth = get_userdata(get_query_var('author'));
            endif;
            echo esc_html( $curauth->nickname );
            echo "</span></span>";
        } elseif (is_search()) {
            echo "<span><span class='treeEnd'>";
            the_search_query();
            echo "</span></span>";
        } elseif (is_tag()) {
            echo "<span><span class='treeEnd'>";
            single_tag_title();
            echo "</span></span>";
        }
    }
}


/*
 * Google Fonts
 */
function luzuk_lite_fonts_url() {
    $fonts_url = '';

    /* Translators: If there are characters in your language that are not
    * supported by Monda, translate this to 'off'. Do not translate
    * into your own language.
    */
    $monda = _x( 'on', 'Monda font: on or off', 'luzuk Premium' );

    if ( 'off' !== $monda ) {
        $font_families = array();

        if ( 'off' !== $monda ) {
            $font_families[] = urldecode('Roboto:400,500,700,900');
        }

        $query_args = array(
            'family' => urlencode( implode( '|', $font_families ) ),
            //'subset' => urlencode( 'latin,latin-ext' ),
        );

        $fonts_url = add_query_arg( $query_args, '//fonts.googleapis.com/css' );
    }

    return $fonts_url;
}

function luzuk_lite_scripts_styles() {
    wp_enqueue_style( 'theme-slug-fonts', luzuk_lite_fonts_url(), array(), null );

}
add_action( 'wp_enqueue_scripts', 'luzuk_lite_scripts_styles' );

/**
 * WP Mega Menu Plugin Support
 */
function luzuk_lite_megamenu_parent_element( $selector ) {
    return '.primary-navigation .container';
}
add_filter( 'wpmm_container_selector', 'luzuk_lite_megamenu_parent_element' );

/**
 * Determines whether the WooCommerce plugin is active or not.
 * @return bool
 */
function luzuk_lite_is_wc_active() {
    if ( is_multisite() ) {
        include_once( ABSPATH . 'wp-admin/includes/plugin.php' );

        return is_plugin_active( 'woocommerce/woocommerce.php' );
    } else {
        return in_array( 'woocommerce/woocommerce.php', apply_filters( 'active_plugins', get_option( 'active_plugins' ) ) );
    }
}

/**
 * WooCommerce
 */
if ( luzuk_lite_is_wc_active() ) {
    if ( !function_exists( 'mts_loop_columns' )) {
        /**
         * Change number or products per row to 3
         *
         * @return int
         */
        function mts_loop_columns() {
            return 3; // 3 products per row
        }
    }
    add_filter( 'loop_shop_columns', 'mts_loop_columns' );

    /**
     * Redefine woocommerce_output_related_products()
     */
    function woocommerce_output_related_products() {
        $args = array(
            'posts_per_page' => 3,
            'columns' => 3,
        );
        woocommerce_related_products($args); // Display 3 products in rows of 1
    }
    
    global $pagenow;
    if ( is_admin() && isset( $_GET['activated'] ) && $pagenow == 'themes.php' ) {
        /**
         * Define WooCommerce image sizes.
         */
        function luzuk_lite_woocommerce_image_dimensions() {
            $catalog = array(
                'width'     => '210',   // px
                'height'    => '155',   // px
                'crop'      => 1        // true
            );
            $single = array(
                'width'     => '326',   // px
                'height'    => '444',   // px
                'crop'      => 1        // true
            );
            $thumbnail = array(
                'width'     => '74',    // px
                'height'    => '74',   // px
                'crop'      => 0        // false
            );
            // Image sizes
            update_option( 'shop_catalog_image_size', $catalog );       // Product category thumbs
            update_option( 'shop_single_image_size', $single );         // Single product image
            update_option( 'shop_thumbnail_image_size', $thumbnail );   // Image gallery thumbs
        }
        add_action( 'init', 'luzuk_lite_woocommerce_image_dimensions', 1 );
    }


    /**
     * Change the number of product thumbnails to show per row to 4.
     *
     * @return int
     */
    function luzuk_lite_woocommerce_thumb_cols() {
     return 4; // .last class applied to every 4th thumbnail
 }
 add_filter( 'woocommerce_product_thumbnails_columns', 'luzuk_lite_woocommerce_thumb_cols' );


    /**
     * Ensure cart contents update when products are added to the cart via AJAX.
     *
     * @param $fragments
     *
     * @return mixed
     */
    function luzuk_lite_header_add_to_cart_fragment( $fragments ) {
        global $woocommerce;
        ob_start(); ?>
        
        <a class="cart-contents" href="<?php echo esc_url( $woocommerce->cart->get_cart_url() ); ?>" title="<?php _e( 'View your shopping cart', 'luzuk Premium' ); ?>"><?php echo sprintf( _n( '%d item', '%d items', $woocommerce->cart->cart_contents_count, 'luzuk Premium' ), $woocommerce->cart->cart_contents_count );?> - <?php echo $woocommerce->cart->get_cart_total(); ?></a>
        
        <?php $fragments['a.cart-contents'] = ob_get_clean();
        return $fragments;
    }
    add_filter( 'add_to_cart_fragments', 'luzuk_lite_header_add_to_cart_fragment' );

    /**
     * Optimize WooCommerce Scripts
     * Updated for WooCommerce 2.0+
     * Remove WooCommerce Generator tag, styles, and scripts from non WooCommerce pages.
     */
    function luzuk_lite_manage_woocommerce_styles() {
        //remove generator meta tag
        remove_action( 'wp_head', array( $GLOBALS['woocommerce'], 'generator' ) );

        //first check that woo exists to prevent fatal errors
        if ( function_exists( 'is_woocommerce' ) ) {
            //dequeue scripts and styles
            if ( ! is_woocommerce() && ! is_cart() && ! is_checkout() ) {
                wp_dequeue_style( 'woocommerce-layout' );
                wp_dequeue_style( 'woocommerce-smallscreen' );
                wp_dequeue_style( 'woocommerce-general' );
                wp_dequeue_style( 'wc-bto-styles' ); //Composites Styles
                wp_dequeue_script( 'wc-add-to-cart' );
                wp_dequeue_script( 'wc-cart-fragments' );
                wp_dequeue_script( 'woocommerce' );
                wp_dequeue_script( 'jquery-blockui' );
                wp_dequeue_script( 'jquery-placeholder' );



            }
        }
    }
    add_action( 'wp_enqueue_scripts', 'luzuk_lite_manage_woocommerce_styles', 99 );

    // Remove WooCommerce generator tag.
    remove_action('wp_head', 'wc_generator_tag');
}

/**
 * Post Layout for Archives
 */
if ( ! function_exists( 'luzuk_lite_archive_post' ) ) {
    /**
     * Display a post of specific layout.
     * 
     * @param string $layout
     */
    function luzuk_lite_archive_post( $layout = '' ) { 
        $luzuk_lite_full_posts = get_theme_mod('luzuk_lite_full_posts', '0'); ?>
    <article class="post excerpt">
                <?php
            if ( is_sticky() && is_home() && ! is_paged() ) {
                printf( '<span class="sticky-post">%s</span>', __( 'Featured', 'luzuk Premium' ) );
            } ?>
        <?php if ( is_single() ) : ?>
        <div class="post-date-publishable"><?php the_time( get_option( 'date_format' ) ); ?></div>
        <?php endif; ?>


<!-- category page -->
            <div class="inner-blog-post col-lg-6 col-md-12 col-sm-12 col-xs-12 wow zoomIn row mr-0">
                <div class="inner-blogpost">
                    <?php if ( empty($luzuk_lite_full_posts) ) : ?>
                        <?php if ( has_post_thumbnail() ) { ?>
                        <div class="ht-blog-thumbnail">
                            <a href="<?php the_permalink(); ?>">
                                <?php the_post_thumbnail('luzuk Premium-featured',array('title' => '')); ?>
                                <?php if (function_exists('wp_review_show_total')) wp_review_show_total(true, 'latestPost-review-wrapper'); ?>
                                <?php if( get_theme_mod('postdate_button_display','show' ) == 'show') :?>
                                <div class="blog-admbx">
                                    <li><?php echo get_the_date( 'M j, Y' ); ?></li>                  
                                </div>
                                <?php endif ?>
                            </a>
                        </div>
                    <?php } else { ?>

                    <?php } ?>                

                    <div class="inner-blogpost-info">
                        <a href="<?php the_permalink(); ?>"><h2><?php the_title(); ?></h2></a> 
                        <div class="inner-blog-excerpt">
                            <?php 
                                if (has_excerpt()) {
                                      echo get_the_excerpt();
                                  } else {
                                      echo luzuk_excerpt(get_the_content(),90);  
                               }
                            ?> 
                        </div>
                        <!-- <?php
                            $blog_button2 = get_theme_mod('blog_button2', 'Read More');
                        ?> -->
                            <!-- <div class="blog-btn">
                                <?php if($blog_button2 ){ ?>    
                                    <a href="<?php echo esc_url(get_permalink()); ?>">
                                        <?php echo ($blog_button2);  ?>
                                        <i class="fa fa-long-arrow-right"></i>
                                    </a>

                                <?php }?>
                            </div> -->
                        <div class="clearfix"></div>
                    </div>
                    <?php else : ?>
                    <?php if (luzuk_lite_post_has_moretag()) : ?>
                    <div class="clearfix"></div>           
                </div>
            </div> 
<!-- END category page -->
            <?php endif; ?>
        <?php endif; ?>
        <div class="clearfix"></div>
    </article>
       
        <?php }
    }


/**
 * Extras
 */
add_action( 'customize_controls_print_styles', 'luzuk_customizer_stylesheet' );

function luzuk_load_custom_wp_admin_style( $hook ) {
    if ( 'appearance_page_about-luzuk_mag' !== $hook ) {
        return;
    }
    wp_enqueue_style( 'luzuk_mag-custom-admin-css', get_template_directory_uri() . '/css/themeinfo.css', false, '1.0.0' );
}
add_action( 'admin_enqueue_scripts', 'luzuk_load_custom_wp_admin_style' );


// Adding Custome Post Type
function createCustomeTypes() {

    // Testimonials Custome type
    register_post_type( 'our-testimonial',
        array(
            'labels' => array(
                'name' => __( 'Testimonials' , 'luzuk Premium'),
                'singular_name' => __( 'Testimonial', 'luzuk Premium' )
            ),
            'public' => true,
            'featured_image'=>true,
            'has_archive' => true,
            'menu_icon' => 'dashicons-format-chat', //  The url to the icon to be used for this menu or the name of the icon from the iconfont
            'supports' => array('title', 'editor', 'thumbnail', 'page-attributes'),
        )
    );


// // team
//     register_post_type( 'our-team',
//         array(
//             'labels' => array(
//                 'name' => __( 'Teams' , 'luzuk'),
//                 'singular_name' => __( 'Team', 'luzuk' )
//             ),
//             'public' => true,
//             'featured_image'=>true,
//             'has_archive' => true,
//             'menu_icon' => 'dashicons-groups', //  The url to the icon to be used for this menu or the name of the icon from the iconfont
//             'supports' => array('title', 'thumbnail', 'author', 'page-attributes'),
//         )
//     );

// Services
    register_post_type( 'our-services',
        array(
            'labels' => array(
                'name' => __( 'Services' , 'luzuk'),
                'singular_name' => __( 'Service', 'luzuk' )
            ),
            'public' => true,
            'featured_image'=>true,
            'has_archive' => true,
            'menu_icon' => 'dashicons-grid-view', //  The url to the icon to be used for this menu or the name of the icon from the iconfont
            'supports' => array('title', 'editor', 'thumbnail', 'author', 'page-attributes'),
        )
    );  

// Skill { My Knowlage }
    register_post_type( 'our-skills',
        array(
            'labels' => array(
                'name' => __( 'Skill' , 'luzuk'),
                'singular_name' => __( 'Skill', 'luzuk' )
            ),
            'public' => true,
            'featured_image'=>true,
            'has_archive' => true,
            'menu_icon' => 'dashicons-list-view', //  The url to the icon to be used for this menu or the name of the icon from the iconfont
            'supports' => array('title', 'editor',  'page-attributes'),
        )
    );    

// Experience 
    register_post_type( 'our-experiences',
        array(
            'labels' => array(
                'name' => __( 'Experience' , 'luzuk'),
                'singular_name' => __( 'Experience', 'luzuk' )
            ),
            'public' => true,
            'featured_image'=>true,
            'has_archive' => true,
            'menu_icon' => 'dashicons-welcome-learn-more', //  The url to the icon to be used for this menu or the name of the icon from the iconfont
            'supports' => array('title', 'thumbnail',),
        )
    );    

// projects 
    // register_post_type( 'our-projects',
    //     array(
    //         'labels' => array(
    //             'name' => __( 'Projects' , 'luzuk'),
    //             'singular_name' => __( 'Project', 'luzuk' )
    //         ),
    //         'public' => true,
    //         'featured_image'=>true,
    //         'has_archive' => true,
    //         'menu_icon' => 'dashicons-layout', //  The url to the icon to be used for this menu or the name of the icon from the iconfont
    //         'supports' => array('title','editor', 'thumbnail',  'page-attributes'),
    //     )
    // );  

// price 
    register_post_type( 'our-prices',
        array(
            'labels' => array(
                'name' => __( 'Pricing' , 'luzuk'),
                'singular_name' => __( 'price', 'luzuk' )
            ),
            'public' => true,
            'featured_image'=>true,
            'has_archive' => true,
            'menu_icon' => 'dashicons-tickets-alt', //  The url to the icon to be used for this menu or the name of the icon from the iconfont
            'supports' => array('title' , 'editor',),
        )
    ); 
    
// Gallery Custome type
    register_post_type( 'our-gallery',
        array(
            'labels' => array(
                'name' => __( 'Gallery' , 'luzuk'),
                'singular_name' => __( 'gallery', 'luzuk' )
            ),
            'public' => true,
            'featured_image'=>true,
            'has_archive' => true,
            'menu_icon' => 'dashicons-admin-media', //  The url to the icon to be used for this menu or the name of the icon from the iconfont
            'supports' => array('title', 'thumbnail', 'page-attributes'),
        )
    ); 
    

// FAQ Custome type
    // register_post_type( 'our-faq',
    //     array(
    //         'labels' => array(
    //             'name' => __( 'FAQs' , 'luzuk'),
    //             'singular_name' => __( 'FAQ', 'luzuk' )
    //         ),
    //         'public' => true,
    //         'featured_image'=>true,
    //         'has_archive' => true,
    //         'menu_icon' => 'dashicons-format-status', //  The url to the icon to be used for this menu or the name of the icon from the iconfont
    //         'supports' => array('title', 'editor', 'page-attributes'),
    //     )
    // );


// SLIDER Custome type
        // register_post_type( 'slider',
        //     array(
        //         'labels' => array(
        //             'name' => __( 'Sliders' , 'Luzuk'),
        //             'singular_name' => __( 'Slider', 'Luzuk' )
        //         ),
        //         'public' => true,
        //         'featured_image'=>true,
        //         'has_archive' => true,
        //         'menu_icon' => 'dashicons-images-alt', //  The url to the icon to be used for this menu or the name of the icon from the iconfont
        //         'supports' => array(''),
        //     )
        // );
        
    }
    
 add_action( 'add_meta_boxes', 'lzLuzukSliderCustomFild' );

/**
 * Method to add the custom field for the slider postsM 
 * @author Luzuk <support@luzuk.com>
 * @since V 1.1  09th Oct 2017
 **/
function lzLuzukSliderCustomFild(){
    add_meta_box( 'luzuk-more-btn-link', __('Slider button link to page', 'luzuk-premium'), 'lzLuzukSliderPages', 'slider', 'normal', 'high' );
}

/**
 * Method to add the custom field's html that to be apears at the admin section
 * @author Luzuk <support@luzuk.com>
 * @since V 1.1  09th Oct 2017
 **/
function lzLuzukSliderPages(){
    global $post;
    // Use nonce for verification
    wp_nonce_field( plugin_basename( __FILE__ ), 'Sider_button_link' );
    //get the saved meta as an array
    $slider_btn_link = get_post_meta($post->ID,'slider_btn_link',false);
    $sliderBtnTxt = get_post_meta($post->ID,'sliderBtnTxt',false);
    $luzuk_pages = get_pages(array('hide_empty' => 0));
    echo '<div>Select the page : ';
    echo '<select name="sliderBtnLink">';
    echo '<option>Select page</option>';
    foreach ($luzuk_pages as $luzuk_pages_single) {
        $selected = ( $luzuk_pages_single->ID == $slider_btn_link[0] )?'selected':'';
        echo '<option value="'.$luzuk_pages_single->ID.'" '.$selected.'>'.$luzuk_pages_single->post_title.'</option>';
    }
    echo '</select></div>';
    echo '<div>Button Text :';
    echo '<input type="text" name="sliderBtnTxt" value="'.$sliderBtnTxt[0].'" /></div>';
}


function saveCustomFieds($post_id){
    // verify if this is an auto save routine. 
    // If it is our form has not been submitted, so we dont want to do anything
    if ( defined( 'DOING_AUTOSAVE' ) && DOING_AUTOSAVE ) 
        return;
    // verify this came from the our screen and with proper authorization,
    // because save_post can be triggered at other times
    if ( !isset( $_POST['Sider_button_link'] ) )
        return;

    if ( !wp_verify_nonce( $_POST['Sider_button_link'], plugin_basename( __FILE__ ) ) )
        return;

    // OK, we're authenticated: we need to find and save the data
    $sliderBtnLink = $_POST['sliderBtnLink'];
    $sliderBtnTxt = $_POST['sliderBtnTxt'];
    update_post_meta($post_id,'slider_btn_link',$sliderBtnLink);
    update_post_meta($post_id,'sliderBtnTxt',$sliderBtnTxt);
}

// add web hook for save the custome field
add_action('save_post', 'saveCustomFieds');
add_action( 'init', 'createCustomeTypes' );


// *** Gallery Categories *******

// Register Custom Taxonomy: Gallery Categories for 'our-gallery' Custom Post Type
function create_gallery_taxonomy() {
    $labels = array(
        'name'              => _x( 'Gallery Categories', 'taxonomy general name', 'luzuk' ),
        'singular_name'     => _x( 'Gallery Category', 'taxonomy singular name', 'luzuk' ),
        'search_items'      => __( 'Search Gallery Categories', 'luzuk' ),
        'all_items'         => __( 'All Gallery Categories', 'luzuk' ),
        'parent_item'       => __( 'Parent Gallery Category', 'luzuk' ),
        'parent_item_colon' => __( 'Parent Gallery Category:', 'luzuk' ),
        'edit_item'         => __( 'Edit Gallery Category', 'luzuk' ),
        'update_item'       => __( 'Update Gallery Category', 'luzuk' ),
        'add_new_item'      => __( 'Add New Gallery Category', 'luzuk' ),
        'new_item_name'     => __( 'New Gallery Category Name', 'luzuk' ),
        'menu_name'         => __( 'Gallery Categories', 'luzuk' ),
    );
    
    $args = array(
        'hierarchical'      => true, // This makes it behave like categories (if set to false, behaves like tags)
        'labels'            => $labels,
        'show_ui'           => true,
        'show_admin_column' => true,
        'query_var'         => true,
        'rewrite'           => array( 'slug' => 'gallery-category' ),
    );
    
    // Register the taxonomy and associate it with the 'our-gallery' post type
    register_taxonomy( 'gallery_category', array( 'our-gallery' ), $args );
}
add_action( 'init', 'create_gallery_taxonomy' );

// Gallery Categories End


// ****************************
// pricing 

// pricing title
function pricingtitleCutomFieldHtml(){
    global $post;
    // get the saved value 
    $pricingtitle = get_post_meta($post->ID, 'pricingtitle', false);
    $pricingtitle = !empty($pricingtitle[0])?$pricingtitle[0]:'';

    // Use nonce for verification
    wp_nonce_field(plugin_basename(__FILE__), ' ');
    echo '<table id="sliderbtntext" width="100%">';
    echo '<tr> 
    <th width="10%"><span class="dashicons dashicons-edit-large"></span></th>
    <td width="90%"><input type="text" name="pricingtitle" width="100%" placeholder="Box Title Here" value="'.$pricingtitle.'" /></td>
    </tr>';
    echo '</table>';

}

function addpricingtitleHook(){
     add_meta_box('pricingtitle', __('Add Box Title', 'luzuk-premium'), 'pricingtitleCutomFieldHtml', 'our-prices', 'normal', 'high');
}

function savepricingtitleCutomData($post_id){
    // If it is our form has not been submitted, so we dont want to do anything
    if(defined('DOING_AUTOSAVE') && DOING_AUTOSAVE)
        return;
     if (isset($_POST['pricingtitle'])) {

    $pricingtitle = $_POST['pricingtitle'];
    update_post_meta($post_id, 'pricingtitle', $pricingtitle);
    
    }
}
add_action('add_meta_boxes', 'addpricingtitleHook');
add_action('save_post', 'savepricingtitleCutomData');

// ****end********

// pricing Price
function pricingpriceCutomFieldHtml(){
    global $post;
    // get the saved value 
    $pricingprice = get_post_meta($post->ID, 'pricingprice', false);
    $pricingprice = !empty($pricingprice[0])?$pricingprice[0]:'';

    // Use nonce for verification
    wp_nonce_field(plugin_basename(__FILE__), ' ');
    echo '<table id="sliderbtntext" width="100%">';
    echo '<tr> 
    <th width="10%"><span class="dashicons dashicons-edit-large"></span></th>
    <td width="90%"><input type="text" name="pricingprice" width="100%" placeholder="Price Here" value="'.$pricingprice.'" /></td>
    </tr>';
    echo '</table>';

}

function addpricingpriceHook(){
     add_meta_box('pricingprice', __('Add Price', 'luzuk-premium'), 'pricingpriceCutomFieldHtml', 'our-prices', 'normal', 'high');
}

function savepricingpriceCutomData($post_id){
    // If it is our form has not been submitted, so we dont want to do anything
    if(defined('DOING_AUTOSAVE') && DOING_AUTOSAVE)
        return;
     if (isset($_POST['pricingprice'])) {

    $pricingprice = $_POST['pricingprice'];
    update_post_meta($post_id, 'pricingprice', $pricingprice);
    
    }
}
add_action('add_meta_boxes', 'addpricingpriceHook');
add_action('save_post', 'savepricingpriceCutomData');

// ****end********

// pricing Days / month / year
function pricingdaysCutomFieldHtml(){
    global $post;
    // get the saved value 
    $pricingdays = get_post_meta($post->ID, 'pricingdays', false);
    $pricingdays = !empty($pricingdays[0])?$pricingdays[0]:'';

    // Use nonce for verification
    wp_nonce_field(plugin_basename(__FILE__), ' ');
    echo '<table id="sliderbtntext" width="100%">';
    echo '<tr> 
    <th width="10%"><span class="dashicons dashicons-edit-large"></span></th>
    <td width="90%"><input type="text" name="pricingdays" width="100%" placeholder="Days Here" value="'.$pricingdays.'" /></td>
    </tr>';
    echo '</table>';

}

function addpricingdaysHook(){
     add_meta_box('pricingdays', __('Add Days', 'luzuk-premium'), 'pricingdaysCutomFieldHtml', 'our-prices', 'normal', 'high');
}

function savepricingdaysCutomData($post_id){
    // If it is our form has not been submitted, so we dont want to do anything
    if(defined('DOING_AUTOSAVE') && DOING_AUTOSAVE)
        return;
     if (isset($_POST['pricingdays'])) {

    $pricingdays = $_POST['pricingdays'];
    update_post_meta($post_id, 'pricingdays', $pricingdays);
    
    }
}
add_action('add_meta_boxes', 'addpricingdaysHook');
add_action('save_post', 'savepricingdaysCutomData');

// ****end********

// pricing buy Button
function pricingbuyCutomFieldHtml(){
    global $post;
    // get the saved value 
    $pricingbuy = get_post_meta($post->ID, 'pricingbuy', false);
    $pricingbuy = !empty($pricingbuy[0])?$pricingbuy[0]:'';

    // Use nonce for verification
    wp_nonce_field(plugin_basename(__FILE__), ' ');
    echo '<table id="sliderbtntext" width="100%">';
    echo '<tr> 
    <th width="10%"><span class="dashicons dashicons-edit-large"></span></th>
    <td width="90%"><input type="text" name="pricingbuy" width="100%" placeholder="Button Text Here" value="'.$pricingbuy.'" /></td>
    </tr>';
    echo '</table>';

}

function addpricingbuyHook(){
     add_meta_box('pricingbuy', __('Button Text 1', 'luzuk-premium'), 'pricingbuyCutomFieldHtml', 'our-prices', 'normal', 'high');
}

function savepricingbuyCutomData($post_id){
    // If it is our form has not been submitted, so we dont want to do anything
    if(defined('DOING_AUTOSAVE') && DOING_AUTOSAVE)
        return;
     if (isset($_POST['pricingbuy'])) {

    $pricingbuy = $_POST['pricingbuy'];
    update_post_meta($post_id, 'pricingbuy', $pricingbuy);
    
    }
}
add_action('add_meta_boxes', 'addpricingbuyHook');
add_action('save_post', 'savepricingbuyCutomData');

// ****end********

// // pricing buy Button link
function pricingbuttonlinkCutomFieldHtml(){
    global $post;
    // get the saved value 
    $pricingbuttonlink = get_post_meta($post->ID, 'pricingbuttonlink', false);
    $pricingbuttonlink = !empty($pricingbuttonlink[0])?$pricingbuttonlink[0]:'';

    // Use nonce for verification
    wp_nonce_field(plugin_basename(__FILE__), ' ');
    echo '<table id="sliderbtntext" width="100%">';
    echo '<tr> 
    <th width="10%"><span class="dashicons dashicons-edit-large"></span></th>
    <td width="90%"><input type="text" name="pricingbuttonlink" width="100%" placeholder="Button Link Here" value="'.$pricingbuttonlink.'" /></td>
    </tr>';
    echo '</table>';

}

function addpricingbuttonlinkHook(){
     add_meta_box('pricingbuttonlink', __('Button Link ', 'luzuk-premium'), 'pricingbuttonlinkCutomFieldHtml', 'our-prices', 'normal', 'high');
}

function savepricingbuttonlinkCutomData($post_id){
    // If it is our form has not been submitted, so we dont want to do anything
    if(defined('DOING_AUTOSAVE') && DOING_AUTOSAVE)
        return;
     if (isset($_POST['pricingbuttonlink'])) {

    $pricingbuttonlink = $_POST['pricingbuttonlink'];
    update_post_meta($post_id, 'pricingbuttonlink', $pricingbuttonlink);
    
    }
}
add_action('add_meta_boxes', 'addpricingbuttonlinkHook');
add_action('save_post', 'savepricingbuttonlinkCutomData');

// ****end********


// ********************
// experience 

// experience title
function exnumCutomFieldHtml(){
    global $post;
    // get the saved value 
    $exnum = get_post_meta($post->ID, 'exnum', false);
    $exnum = !empty($exnum[0])?$exnum[0]:'';

    // Use nonce for verification
    wp_nonce_field(plugin_basename(__FILE__), ' ');
    echo '<table id="sliderbtntext" width="100%">';
    echo '<tr> 
    <th width="10%"><span class="dashicons dashicons-edit-large"></span></th>
    <td width="90%"><input type="text" name="exnum" width="100%" placeholder="Number" value="'.$exnum.'" /></td>
    </tr>';
    echo '</table>';

}

function addexnumHook(){
     add_meta_box('exnum', __('Add Experience Number', 'luzuk-premium'), 'exnumCutomFieldHtml', 'our-experiences', 'normal', 'high');
}

function saveexnumCutomData($post_id){
    // If it is our form has not been submitted, so we dont want to do anything
    if(defined('DOING_AUTOSAVE') && DOING_AUTOSAVE)
        return;
     if (isset($_POST['exnum'])) {

    $exnum = $_POST['exnum'];
    update_post_meta($post_id, 'exnum', $exnum);
    
    }
}
add_action('add_meta_boxes', 'addexnumHook');
add_action('save_post', 'saveexnumCutomData');

// ****end********


// experience year
function exyerCutomFieldHtml(){
    global $post;
    // get the saved value 
    $exyer = get_post_meta($post->ID, 'exyer', false);
    $exyer = !empty($exyer[0])?$exyer[0]:'';

    // Use nonce for verification
    wp_nonce_field(plugin_basename(__FILE__), ' ');
    echo '<table id="sliderbtntext" width="100%">';
    echo '<tr> 
    <th width="10%"><span class="dashicons dashicons-edit-large"></span></th>
    <td width="90%"><input type="text" name="exyer" width="100%" placeholder="Text" value="'.$exyer.'" /></td>
    </tr>';
    echo '</table>';

}

function addexyerHook(){
     add_meta_box('exyer', __('Year Text', 'luzuk-premium'), 'exyerCutomFieldHtml', 'our-experiences', 'normal', 'high');
}

function saveexyerCutomData($post_id){
    // If it is our form has not been submitted, so we dont want to do anything
    if(defined('DOING_AUTOSAVE') && DOING_AUTOSAVE)
        return;
     if (isset($_POST['exyer'])) {

    $exyer = $_POST['exyer'];
    update_post_meta($post_id, 'exyer', $exyer);
    
    }
}
add_action('add_meta_boxes', 'addexyerHook');
add_action('save_post', 'saveexyerCutomData');

// ****end********

//left side experience Title
function extitleCutomFieldHtml(){
    global $post;
    // get the saved value 
    $extitle = get_post_meta($post->ID, 'extitle', false);
    $extitle = !empty($extitle[0])?$extitle[0]:'';

    // Use nonce for verification
    wp_nonce_field(plugin_basename(__FILE__), ' ');
    echo '<table id="sliderbtntext" width="100%">';
    echo '<tr> 
    <th width="10%"><span class="dashicons dashicons-edit-large"></span></th>
    <td width="90%"><input type="text" name="extitle" width="100%" placeholder="Title" value="'.$extitle.'" /></td>
    </tr>';
    echo '</table>';

}

function addextitleHook(){
     add_meta_box('extitle', __('Left Side Experience Title', 'luzuk-premium'), 'extitleCutomFieldHtml', 'our-experiences', 'normal', 'high');
}

function saveextitleCutomData($post_id){
    // If it is our form has not been submitted, so we dont want to do anything
    if(defined('DOING_AUTOSAVE') && DOING_AUTOSAVE)
        return;
     if (isset($_POST['extitle'])) {

    $extitle = $_POST['extitle'];
    update_post_meta($post_id, 'extitle', $extitle);
    
    }
}
add_action('add_meta_boxes', 'addextitleHook');
add_action('save_post', 'saveextitleCutomData');

// ****end********
// Right Side
// experience Heding
function expRbxheadingCutomFieldHtml(){
    global $post;
    // get the saved value 
    $expRbxheading = get_post_meta($post->ID, 'expRbxheading', false);
    $expRbxheading = !empty($expRbxheading[0])?$expRbxheading[0]:'';

    // Use nonce for verification
    wp_nonce_field(plugin_basename(__FILE__), ' ');
    echo '<table id="sliderbtntext" width="100%">';
    echo '<tr> 
    <th width="10%"><span class="dashicons dashicons-edit-large"></span></th>
    <td width="90%"><input type="text" name="expRbxheading" width="100%" placeholder="Heading" value="'.$expRbxheading.'" /></td>
    </tr>';
    echo '</table>';

}

function addexpRbxheadingHook(){
     add_meta_box('expRbxheading', __(' Experience Heading', 'luzuk-premium'), 'expRbxheadingCutomFieldHtml', 'our-experiences', 'normal', 'high');
}

function saveexpRbxheadingCutomData($post_id){
    // If it is our form has not been submitted, so we dont want to do anything
    if(defined('DOING_AUTOSAVE') && DOING_AUTOSAVE)
        return;
     if (isset($_POST['expRbxheading'])) {

    $expRbxheading = $_POST['expRbxheading'];
    update_post_meta($post_id, 'expRbxheading', $expRbxheading);
    
    }
}
add_action('add_meta_boxes', 'addexpRbxheadingHook');
add_action('save_post', 'saveexpRbxheadingCutomData');

// ****end********

// 1st box
//Right experience Title 1
function expRbxtitle1CutomFieldHtml(){
    global $post;
    // get the saved value 
    $expRbxtitle1 = get_post_meta($post->ID, 'expRbxtitle1', false);
    $expRbxtitle1 = !empty($expRbxtitle1[0])?$expRbxtitle1[0]:'';

    // Use nonce for verification
    wp_nonce_field(plugin_basename(__FILE__), ' ');
    echo '<table id="sliderbtntext" width="100%">';
    echo '<tr> 
    <th width="10%"><span class="dashicons dashicons-edit-large"></span></th>
    <td width="90%"><input type="text" name="expRbxtitle1" width="100%" placeholder="Text" value="'.$expRbxtitle1.'" /></td>
    </tr>';
    echo '</table>';

}

function addexpRbxtitle1Hook(){
     add_meta_box('expRbxtitle1', __(' Work 1', 'luzuk-premium'), 'expRbxtitle1CutomFieldHtml', 'our-experiences', 'normal', 'high');
}

function saveexpRbxtitle1CutomData($post_id){
    // If it is our form has not been submitted, so we dont want to do anything
    if(defined('DOING_AUTOSAVE') && DOING_AUTOSAVE)
        return;
     if (isset($_POST['expRbxtitle1'])) {

    $expRbxtitle1 = $_POST['expRbxtitle1'];
    update_post_meta($post_id, 'expRbxtitle1', $expRbxtitle1);
    
    }
}
add_action('add_meta_boxes', 'addexpRbxtitle1Hook');
add_action('save_post', 'saveexpRbxtitle1CutomData');

// ****end********

// experience Year Num 1
function expRbxynum1CutomFieldHtml(){
    global $post;
    // get the saved value 
    $expRbxynum1 = get_post_meta($post->ID, 'expRbxynum1', false);
    $expRbxynum1 = !empty($expRbxynum1[0])?$expRbxynum1[0]:'';

    // Use nonce for verification
    wp_nonce_field(plugin_basename(__FILE__), ' ');
    echo '<table id="sliderbtntext" width="100%">';
    echo '<tr> 
    <th width="10%"><span class="dashicons dashicons-edit-large"></span></th>
    <td width="90%"><input type="text" name="expRbxynum1" width="100%" placeholder="Number" value="'.$expRbxynum1.'" /></td>
    </tr>';
    echo '</table>';

}

function addexpRbxynum1Hook(){
     add_meta_box('expRbxynum1', __(' Experience Year 1', 'luzuk-premium'), 'expRbxynum1CutomFieldHtml', 'our-experiences', 'normal', 'high');
}

function saveexpRbxynum1CutomData($post_id){
    // If it is our form has not been submitted, so we dont want to do anything
    if(defined('DOING_AUTOSAVE') && DOING_AUTOSAVE)
        return;
     if (isset($_POST['expRbxynum1'])) {

    $expRbxynum1 = $_POST['expRbxynum1'];
    update_post_meta($post_id, 'expRbxynum1', $expRbxynum1);
    
    }
}
add_action('add_meta_boxes', 'addexpRbxynum1Hook');
add_action('save_post', 'saveexpRbxynum1CutomData');

// ****end********

//post 1
function exppost1CutomFieldHtml(){
    global $post;
    // get the saved value 
    $exppost1 = get_post_meta($post->ID, 'exppost1', false);
    $exppost1 = !empty($exppost1[0])?$exppost1[0]:'';

    // Use nonce for verification
    wp_nonce_field(plugin_basename(__FILE__), ' ');
    echo '<table id="sliderbtntext" width="100%">';
    echo '<tr> 
    <th width="10%"><span class="dashicons dashicons-edit-large"></span></th>
    <td width="90%"><input type="text" name="exppost1" width="100%" placeholder="Text" value="'.$exppost1.'" /></td>
    </tr>';
    echo '</table>';

}

function addexppost1Hook(){
     add_meta_box('exppost1', __(' Company Name 1', 'luzuk-premium'), 'exppost1CutomFieldHtml', 'our-experiences', 'normal', 'high');
}

function saveexppost1CutomData($post_id){
    // If it is our form has not been submitted, so we dont want to do anything
    if(defined('DOING_AUTOSAVE') && DOING_AUTOSAVE)
        return;
     if (isset($_POST['exppost1'])) {

    $exppost1 = $_POST['exppost1'];
    update_post_meta($post_id, 'exppost1', $exppost1);
    
    }
}
add_action('add_meta_boxes', 'addexppost1Hook');
add_action('save_post', 'saveexppost1CutomData');

// ****end********

//Exp Text 1
function exptxt1CutomFieldHtml(){
    global $post;
    // get the saved value 
    $exptxt1 = get_post_meta($post->ID, 'exptxt1', false);
    $exptxt1 = !empty($exptxt1[0])?$exptxt1[0]:'';

    // Use nonce for verification
    wp_nonce_field(plugin_basename(__FILE__), ' ');
    echo '<table id="sliderbtntext" width="100%">';
    echo '<tr> 
    <th width="10%"><span class="dashicons dashicons-edit-large"></span></th>
     <td width="90%"><textarea name="exptxt1" style="width: 100%;" placeholder="Text">' . esc_textarea($exptxt1) . '</textarea></td>
    </tr>';
    echo '</table>';

}

function addexptxt1Hook(){
     add_meta_box('exptxt1', __(' Text 1', 'luzuk-premium'), 'exptxt1CutomFieldHtml', 'our-experiences', 'normal', 'high');
}

function saveexptxt1CutomData($post_id){
    // If it is our form has not been submitted, so we dont want to do anything
    if(defined('DOING_AUTOSAVE') && DOING_AUTOSAVE)
        return;
     if (isset($_POST['exptxt1'])) {

    $exptxt1 = $_POST['exptxt1'];
    update_post_meta($post_id, 'exptxt1', $exptxt1);
    
    }
}
add_action('add_meta_boxes', 'addexptxt1Hook');
add_action('save_post', 'saveexptxt1CutomData');

// ****end********
// 2nd box
//Right experience Title 2
function expRbxtitle2CutomFieldHtml(){
    global $post;
    // get the saved value 
    $expRbxtitle2 = get_post_meta($post->ID, 'expRbxtitle2', false);
    $expRbxtitle2 = !empty($expRbxtitle2[0])?$expRbxtitle2[0]:'';

    // Use nonce for verification
    wp_nonce_field(plugin_basename(__FILE__), ' ');
    echo '<table id="sliderbtntext" width="100%">';
    echo '<tr> 
    <th width="10%"><span class="dashicons dashicons-edit-large"></span></th>
    <td width="90%"><input type="text" name="expRbxtitle2" width="100%" placeholder="Title" value="'.$expRbxtitle2.'" /></td>
    </tr>';
    echo '</table>';

}

function addexpRbxtitle2Hook(){
     add_meta_box('expRbxtitle2', __(' Work 2', 'luzuk-premium'), 'expRbxtitle2CutomFieldHtml', 'our-experiences', 'normal', 'high');
}

function saveexpRbxtitle2CutomData($post_id){
    // If it is our form has not been submitted, so we dont want to do anything
    if(defined('DOING_AUTOSAVE') && DOING_AUTOSAVE)
        return;
     if (isset($_POST['expRbxtitle2'])) {

    $expRbxtitle2 = $_POST['expRbxtitle2'];
    update_post_meta($post_id, 'expRbxtitle2', $expRbxtitle2);
    
    }
}
add_action('add_meta_boxes', 'addexpRbxtitle2Hook');
add_action('save_post', 'saveexpRbxtitle2CutomData');

// ****end********

// experience Year Num 2
function expRbxynum2CutomFieldHtml(){
    global $post;
    // get the saved value 
    $expRbxynum2 = get_post_meta($post->ID, 'expRbxynum2', false);
    $expRbxynum2 = !empty($expRbxynum2[0])?$expRbxynum2[0]:'';

    // Use nonce for verification
    wp_nonce_field(plugin_basename(__FILE__), ' ');
    echo '<table id="sliderbtntext" width="100%">';
    echo '<tr> 
    <th width="10%"><span class="dashicons dashicons-edit-large"></span></th>
    <td width="90%"><input type="text" name="expRbxynum2" width="100%" placeholder="Number" value="'.$expRbxynum2.'" /></td>
    </tr>';
    echo '</table>';

}

function addexpRbxynum2Hook(){
     add_meta_box('expRbxynum2', __(' Experience Year 2', 'luzuk-premium'), 'expRbxynum2CutomFieldHtml', 'our-experiences', 'normal', 'high');
}

function saveexpRbxynum2CutomData($post_id){
    // If it is our form has not been submitted, so we dont want to do anything
    if(defined('DOING_AUTOSAVE') && DOING_AUTOSAVE)
        return;
     if (isset($_POST['expRbxynum2'])) {

    $expRbxynum2 = $_POST['expRbxynum2'];
    update_post_meta($post_id, 'expRbxynum2', $expRbxynum2);
    
    }
}
add_action('add_meta_boxes', 'addexpRbxynum2Hook');
add_action('save_post', 'saveexpRbxynum2CutomData');

// ****end********


//post 2
function exppost2CutomFieldHtml(){
    global $post;
    // get the saved value 
    $exppost2 = get_post_meta($post->ID, 'exppost2', false);
    $exppost2 = !empty($exppost2[0])?$exppost2[0]:'';

    // Use nonce for verification
    wp_nonce_field(plugin_basename(__FILE__), ' ');
    echo '<table id="sliderbtntext" width="100%">';
    echo '<tr> 
    <th width="10%"><span class="dashicons dashicons-edit-large"></span></th>
    <td width="90%"><input type="text" name="exppost2" width="100%" placeholder="Text" value="'.$exppost2.'" /></td>
    </tr>';
    echo '</table>';

}

function addexppost2Hook(){
     add_meta_box('exppost2', __(' Company Name 2', 'luzuk-premium'), 'exppost2CutomFieldHtml', 'our-experiences', 'normal', 'high');
}

function saveexppost2CutomData($post_id){
    // If it is our form has not been submitted, so we dont want to do anything
    if(defined('DOING_AUTOSAVE') && DOING_AUTOSAVE)
        return;
     if (isset($_POST['exppost2'])) {

    $exppost2 = $_POST['exppost2'];
    update_post_meta($post_id, 'exppost2', $exppost2);
    
    }
}
add_action('add_meta_boxes', 'addexppost2Hook');
add_action('save_post', 'saveexppost2CutomData');

// ****end********

//Exp Text 2
function exptxt2CutomFieldHtml(){
    global $post;
    // get the saved value 
    $exptxt2 = get_post_meta($post->ID, 'exptxt2', false);
    $exptxt2 = !empty($exptxt2[0])?$exptxt2[0]:'';

    // Use nonce for verification
    wp_nonce_field(plugin_basename(__FILE__), ' ');
    echo '<table id="sliderbtntext" width="100%">';
    echo '<tr> 
    <th width="10%"><span class="dashicons dashicons-edit-large"></span></th>
     <td width="90%"><textarea name="exptxt2" style="width: 100%;" placeholder="Text">' . esc_textarea($exptxt2) . '</textarea></td>
    </tr>';
    echo '</table>';

}

function addexptxt2Hook(){
     add_meta_box('exptxt2', __(' Text 2', 'luzuk-premium'), 'exptxt2CutomFieldHtml', 'our-experiences', 'normal', 'high');
}

function saveexptxt2CutomData($post_id){
    // If it is our form has not been submitted, so we dont want to do anything
    if(defined('DOING_AUTOSAVE') && DOING_AUTOSAVE)
        return;
     if (isset($_POST['exptxt2'])) {

    $exptxt2 = $_POST['exptxt2'];
    update_post_meta($post_id, 'exptxt2', $exptxt2);
    
    }
}
add_action('add_meta_boxes', 'addexptxt2Hook');
add_action('save_post', 'saveexptxt2CutomData');

// ****end********

// 3nd box
//Right experience Title 3
function expRbxtitle3CutomFieldHtml(){
    global $post;
    // get the saved value 
    $expRbxtitle3 = get_post_meta($post->ID, 'expRbxtitle3', false);
    $expRbxtitle3 = !empty($expRbxtitle3[0])?$expRbxtitle3[0]:'';

    // Use nonce for verification
    wp_nonce_field(plugin_basename(__FILE__), ' ');
    echo '<table id="sliderbtntext" width="100%">';
    echo '<tr> 
    <th width="10%"><span class="dashicons dashicons-edit-large"></span></th>
    <td width="90%"><input type="text" name="expRbxtitle3" width="100%" placeholder="Title" value="'.$expRbxtitle3.'" /></td>
    </tr>';
    echo '</table>';

}

function addexpRbxtitle3Hook(){
     add_meta_box('expRbxtitle3', __(' Work 3', 'luzuk-premium'), 'expRbxtitle3CutomFieldHtml', 'our-experiences', 'normal', 'high');
}

function saveexpRbxtitle3CutomData($post_id){
    // If it is our form has not been submitted, so we dont want to do anything
    if(defined('DOING_AUTOSAVE') && DOING_AUTOSAVE)
        return;
     if (isset($_POST['expRbxtitle3'])) {

    $expRbxtitle3 = $_POST['expRbxtitle3'];
    update_post_meta($post_id, 'expRbxtitle3', $expRbxtitle3);  
    }
}
add_action('add_meta_boxes', 'addexpRbxtitle3Hook');
add_action('save_post', 'saveexpRbxtitle3CutomData');

// ****end********

// experience Year Num 3
function expRbxynum3CutomFieldHtml(){
    global $post;
    // get the saved value 
    $expRbxynum3 = get_post_meta($post->ID, 'expRbxynum3', false);
    $expRbxynum3 = !empty($expRbxynum3[0])?$expRbxynum3[0]:'';

    // Use nonce for verification
    wp_nonce_field(plugin_basename(__FILE__), ' ');
    echo '<table id="sliderbtntext" width="100%">';
    echo '<tr> 
    <th width="10%"><span class="dashicons dashicons-edit-large"></span></th>
    <td width="90%"><input type="text" name="expRbxynum3" width="100%" placeholder="Number" value="'.$expRbxynum3.'" /></td>
    </tr>';
    echo '</table>';

}

function addexpRbxynum3Hook(){
     add_meta_box('expRbxynum3', __(' Experience Year 3', 'luzuk-premium'), 'expRbxynum3CutomFieldHtml', 'our-experiences', 'normal', 'high');
}

function saveexpRbxynum3CutomData($post_id){
    // If it is our form has not been submitted, so we dont want to do anything
    if(defined('DOING_AUTOSAVE') && DOING_AUTOSAVE)
        return;
     if (isset($_POST['expRbxynum3'])) {

    $expRbxynum3 = $_POST['expRbxynum3'];
    update_post_meta($post_id, 'expRbxynum3', $expRbxynum3);
    
    }
}
add_action('add_meta_boxes', 'addexpRbxynum3Hook');
add_action('save_post', 'saveexpRbxynum3CutomData');

// ****end********


//post 3
function exppost3CutomFieldHtml(){
    global $post;
    // get the saved value 
    $exppost3 = get_post_meta($post->ID, 'exppost3', false);
    $exppost3 = !empty($exppost3[0])?$exppost3[0]:'';

    // Use nonce for verification
    wp_nonce_field(plugin_basename(__FILE__), ' ');
    echo '<table id="sliderbtntext" width="100%">';
    echo '<tr> 
    <th width="10%"><span class="dashicons dashicons-edit-large"></span></th>
    <td width="90%"><input type="text" name="exppost3" width="100%" placeholder="Text" value="'.$exppost3.'" /></td>
    </tr>';
    echo '</table>';
}

function addexppost3Hook(){
     add_meta_box('exppost3', __(' Company Name 3', 'luzuk-premium'), 'exppost3CutomFieldHtml', 'our-experiences', 'normal', 'high');
}

function saveexppost3CutomData($post_id){
    // If it is our form has not been submitted, so we dont want to do anything
    if(defined('DOING_AUTOSAVE') && DOING_AUTOSAVE)
        return;
     if (isset($_POST['exppost3'])) {

    $exppost3 = $_POST['exppost3'];
    update_post_meta($post_id, 'exppost3', $exppost3);
    
    }
}
add_action('add_meta_boxes', 'addexppost3Hook');
add_action('save_post', 'saveexppost3CutomData');

// ****end********

//Exp Text 3
function exptxt3CutomFieldHtml(){
    global $post;
    // get the saved value 
    $exptxt3 = get_post_meta($post->ID, 'exptxt3', false);
    $exptxt3 = !empty($exptxt3[0])?$exptxt3[0]:'';

    // Use nonce for verification
    wp_nonce_field(plugin_basename(__FILE__), ' ');
    echo '<table id="sliderbtntext" width="100%">';
    echo '<tr> 
    <th width="10%"><span class="dashicons dashicons-edit-large"></span></th>
     <td width="90%"><textarea name="exptxt3" style="width: 100%;" placeholder="Text">' . esc_textarea($exptxt3) . '</textarea></td>
    </tr>';
    echo '</table>';

}

function addexptxt3Hook(){
     add_meta_box('exptxt3', __(' Text 3', 'luzuk-premium'), 'exptxt3CutomFieldHtml', 'our-experiences', 'normal', 'high');
}

function saveexptxt3CutomData($post_id){
    // If it is our form has not been submitted, so we dont want to do anything
    if(defined('DOING_AUTOSAVE') && DOING_AUTOSAVE)
        return;
     if (isset($_POST['exptxt3'])) {

    $exptxt3 = $_POST['exptxt3'];
    update_post_meta($post_id, 'exptxt3', $exptxt3);
    
    }
}
add_action('add_meta_boxes', 'addexptxt3Hook');
add_action('save_post', 'saveexptxt3CutomData');

// ****end********

// 4th box
//Right experience Title 4
function expRbxtitle4CutomFieldHtml(){
    global $post;
    // get the saved value 
    $expRbxtitle4 = get_post_meta($post->ID, 'expRbxtitle4', false);
    $expRbxtitle4 = !empty($expRbxtitle4[0])?$expRbxtitle4[0]:'';

    // Use nonce for verification
    wp_nonce_field(plugin_basename(__FILE__), ' ');
    echo '<table id="sliderbtntext" width="100%">';
    echo '<tr> 
    <th width="10%"><span class="dashicons dashicons-edit-large"></span></th>
    <td width="90%"><input type="text" name="expRbxtitle4" width="100%" placeholder="Title" value="'.$expRbxtitle4.'" /></td>
    </tr>';
    echo '</table>';

}

function addexpRbxtitle4Hook(){
     add_meta_box('expRbxtitle4', __(' Work 4', 'luzuk-premium'), 'expRbxtitle4CutomFieldHtml', 'our-experiences', 'normal', 'high');
}

function saveexpRbxtitle4CutomData($post_id){
    // If it is our form has not been submitted, so we dont want to do anything
    if(defined('DOING_AUTOSAVE') && DOING_AUTOSAVE)
        return;
     if (isset($_POST['expRbxtitle4'])) {

    $expRbxtitle4 = $_POST['expRbxtitle4'];
    update_post_meta($post_id, 'expRbxtitle4', $expRbxtitle4);  
    }
}
add_action('add_meta_boxes', 'addexpRbxtitle4Hook');
add_action('save_post', 'saveexpRbxtitle4CutomData');

// ****end********

// experience Year Num 4
function expRbxynum4CutomFieldHtml(){
    global $post;
    // get the saved value 
    $expRbxynum4 = get_post_meta($post->ID, 'expRbxynum4', false);
    $expRbxynum4 = !empty($expRbxynum4[0])?$expRbxynum4[0]:'';

    // Use nonce for verification
    wp_nonce_field(plugin_basename(__FILE__), ' ');
    echo '<table id="sliderbtntext" width="100%">';
    echo '<tr> 
    <th width="10%"><span class="dashicons dashicons-edit-large"></span></th>
    <td width="90%"><input type="text" name="expRbxynum4" width="100%" placeholder="Number" value="'.$expRbxynum4.'" /></td>
    </tr>';
    echo '</table>';

}

function addexpRbxynum4Hook(){
     add_meta_box('expRbxynum4', __(' Experience Year 4', 'luzuk-premium'), 'expRbxynum4CutomFieldHtml', 'our-experiences', 'normal', 'high');
}

function saveexpRbxynum4CutomData($post_id){
    // If it is our form has not been submitted, so we dont want to do anything
    if(defined('DOING_AUTOSAVE') && DOING_AUTOSAVE)
        return;
     if (isset($_POST['expRbxynum4'])) {

    $expRbxynum4 = $_POST['expRbxynum4'];
    update_post_meta($post_id, 'expRbxynum4', $expRbxynum4);
    
    }
}
add_action('add_meta_boxes', 'addexpRbxynum4Hook');
add_action('save_post', 'saveexpRbxynum4CutomData');

// ****end********

//post 4
function exppost4CutomFieldHtml(){
    global $post;
    // get the saved value 
    $exppost4 = get_post_meta($post->ID, 'exppost4', false);
    $exppost4 = !empty($exppost4[0])?$exppost4[0]:'';

    // Use nonce for verification
    wp_nonce_field(plugin_basename(__FILE__), ' ');
    echo '<table id="sliderbtntext" width="100%">';
    echo '<tr> 
    <th width="10%"><span class="dashicons dashicons-edit-large"></span></th>
    <td width="90%"><input type="text" name="exppost4" width="100%" placeholder="Text" value="'.$exppost4.'" /></td>
    </tr>';
    echo '</table>';
}

function addexppost4Hook(){
     add_meta_box('exppost4', __(' Company Name 4', 'luzuk-premium'), 'exppost4CutomFieldHtml', 'our-experiences', 'normal', 'high');
}

function saveexppost4CutomData($post_id){
    // If it is our form has not been submitted, so we dont want to do anything
    if(defined('DOING_AUTOSAVE') && DOING_AUTOSAVE)
        return;
     if (isset($_POST['exppost4'])) {

    $exppost4 = $_POST['exppost4'];
    update_post_meta($post_id, 'exppost4', $exppost4);
    
    }
}
add_action('add_meta_boxes', 'addexppost4Hook');
add_action('save_post', 'saveexppost4CutomData');

// ****end********

//Exp Text 4
function exptxt4CutomFieldHtml(){
    global $post;
    // get the saved value 
    $exptxt4 = get_post_meta($post->ID, 'exptxt4', false);
    $exptxt4 = !empty($exptxt4[0])?$exptxt4[0]:'';

    // Use nonce for verification
    wp_nonce_field(plugin_basename(__FILE__), ' ');
    echo '<table id="sliderbtntext" width="100%">';
    echo '<tr> 
    <th width="10%"><span class="dashicons dashicons-edit-large"></span></th>
     <td width="90%"><textarea name="exptxt4" style="width: 100%;" placeholder="Text">' . esc_textarea($exptxt4) . '</textarea></td>
    </tr>';
    echo '</table>';

}

function addexptxt4Hook(){
     add_meta_box('exptxt4', __(' Text 4', 'luzuk-premium'), 'exptxt4CutomFieldHtml', 'our-experiences', 'normal', 'high');
}

function saveexptxt4CutomData($post_id){
    // If it is our form has not been submitted, so we dont want to do anything
    if(defined('DOING_AUTOSAVE') && DOING_AUTOSAVE)
        return;
     if (isset($_POST['exptxt4'])) {

    $exptxt4 = $_POST['exptxt4'];
    update_post_meta($post_id, 'exptxt4', $exptxt4);
    
    }
}
add_action('add_meta_boxes', 'addexptxt4Hook');
add_action('save_post', 'saveexptxt4CutomData');

// ****end********

//Education Heading
function eduRbxheadingCutomFieldHtml(){
    global $post;
    // get the saved value 
    $eduRbxheading = get_post_meta($post->ID, 'eduRbxheading', false);
    $eduRbxheading = !empty($eduRbxheading[0])?$eduRbxheading[0]:'';

    // Use nonce for verification
    wp_nonce_field(plugin_basename(__FILE__), ' ');
    echo '<table id="sliderbtntext" width="100%">';
    echo '<tr> 
    <th width="10%"><span class="dashicons dashicons-edit-large"></span></th>
    <td width="90%"><input type="text" name="eduRbxheading" width="100%" placeholder="Heading" value="'.$eduRbxheading.'" /></td>
    </tr>';
    echo '</table>';

}

function addeduRbxheadingHook(){
     add_meta_box('eduRbxheading', __(' Education Heading', 'luzuk-premium'), 'eduRbxheadingCutomFieldHtml', 'our-experiences', 'normal', 'high');
}

function saveeduRbxheadingCutomData($post_id){
    // If it is our form has not been submitted, so we dont want to do anything
    if(defined('DOING_AUTOSAVE') && DOING_AUTOSAVE)
        return;
     if (isset($_POST['eduRbxheading'])) {

    $eduRbxheading = $_POST['eduRbxheading'];
    update_post_meta($post_id, 'eduRbxheading', $eduRbxheading);
    
    }
}
add_action('add_meta_boxes', 'addeduRbxheadingHook');
add_action('save_post', 'saveeduRbxheadingCutomData');

// ****end********

//Education Year  1
function eduRbxnum1CutomFieldHtml(){
    global $post;
    // get the saved value 
    $eduRbxnum1 = get_post_meta($post->ID, 'eduRbxnum1', false);
    $eduRbxnum1 = !empty($eduRbxnum1[0])?$eduRbxnum1[0]:'';

    // Use nonce for verification
    wp_nonce_field(plugin_basename(__FILE__), ' ');
    echo '<table id="sliderbtntext" width="100%">';
    echo '<tr> 
    <th width="10%"><span class="dashicons dashicons-edit-large"></span></th>
    <td width="90%"><input type="text" name="eduRbxnum1" width="100%" placeholder="Number" value="'.$eduRbxnum1.'" /></td>
    </tr>';
    echo '</table>';

}

function addeduRbxnum1Hook(){
     add_meta_box('eduRbxnum1', __(' Education Year 1', 'luzuk-premium'), 'eduRbxnum1CutomFieldHtml', 'our-experiences', 'normal', 'high');
}

function saveeduRbxnum1CutomData($post_id){
    // If it is our form has not been submitted, so we dont want to do anything
    if(defined('DOING_AUTOSAVE') && DOING_AUTOSAVE)
        return;
     if (isset($_POST['eduRbxnum1'])) {

    $eduRbxnum1 = $_POST['eduRbxnum1'];
    update_post_meta($post_id, 'eduRbxnum1', $eduRbxnum1);
    
    }
}
add_action('add_meta_boxes', 'addeduRbxnum1Hook');
add_action('save_post', 'saveeduRbxnum1CutomData');

// ****end********

//Education Title 1
function eduRbxtitle1CutomFieldHtml(){
    global $post;
    // get the saved value 
    $eduRbxtitle1 = get_post_meta($post->ID, 'eduRbxtitle1', false);
    $eduRbxtitle1 = !empty($eduRbxtitle1[0])?$eduRbxtitle1[0]:'';

    // Use nonce for verification
    wp_nonce_field(plugin_basename(__FILE__), ' ');
    echo '<table id="sliderbtntext" width="100%">';
    echo '<tr> 
    <th width="10%"><span class="dashicons dashicons-edit-large"></span></th>
    <td width="90%"><input type="text" name="eduRbxtitle1" width="100%" placeholder="Title" value="'.$eduRbxtitle1.'" /></td>
    </tr>';
    echo '</table>';

}

function addeduRbxtitle1Hook(){
     add_meta_box('eduRbxtitle1', __(' Education Title 1', 'luzuk-premium'), 'eduRbxtitle1CutomFieldHtml', 'our-experiences', 'normal', 'high');
}

function saveeduRbxtitle1CutomData($post_id){
    // If it is our form has not been submitted, so we dont want to do anything
    if(defined('DOING_AUTOSAVE') && DOING_AUTOSAVE)
        return;
     if (isset($_POST['eduRbxtitle1'])) {

    $eduRbxtitle1 = $_POST['eduRbxtitle1'];
    update_post_meta($post_id, 'eduRbxtitle1', $eduRbxtitle1);
    
    }
}
add_action('add_meta_boxes', 'addeduRbxtitle1Hook');
add_action('save_post', 'saveeduRbxtitle1CutomData');

// ****end********

//Nation Name 1
function edupost1CutomFieldHtml(){
    global $post;
    // get the saved value 
    $edupost1 = get_post_meta($post->ID, 'edupost1', false);
    $edupost1 = !empty($edupost1[0])?$edupost1[0]:'';

    // Use nonce for verification
    wp_nonce_field(plugin_basename(__FILE__), ' ');
    echo '<table id="sliderbtntext" width="100%">';
    echo '<tr> 
    <th width="10%"><span class="dashicons dashicons-edit-large"></span></th>
    <td width="90%"><input type="text" name="edupost1" width="100%" placeholder="Text" value="'.$edupost1.'" /></td>
    </tr>';
    echo '</table>';

}

function addedupost1Hook(){
     add_meta_box('edupost1', __(' Address 1', 'luzuk-premium'), 'edupost1CutomFieldHtml', 'our-experiences', 'normal', 'high');
}

function saveedupost1CutomData($post_id){
    // If it is our form has not been submitted, so we dont want to do anything
    if(defined('DOING_AUTOSAVE') && DOING_AUTOSAVE)
        return;
     if (isset($_POST['edupost1'])) {

    $edupost1 = $_POST['edupost1'];
    update_post_meta($post_id, 'edupost1', $edupost1);
    
    }
}
add_action('add_meta_boxes', 'addedupost1Hook');
add_action('save_post', 'saveedupost1CutomData');

// ****end********

//Edu Text 1
function edutxt1CutomFieldHtml(){
    global $post;
    // get the saved value 
    $edutxt1 = get_post_meta($post->ID, 'edutxt1', false);
    $edutxt1 = !empty($edutxt1[0])?$edutxt1[0]:'';

    // Use nonce for verification
    wp_nonce_field(plugin_basename(__FILE__), ' ');
    echo '<table id="sliderbtntext" width="100%">';
    echo '<tr> 
    <th width="10%"><span class="dashicons dashicons-edit-large"></span></th>
     <td width="90%"><textarea name="edutxt1" style="width: 100%;" placeholder="Text">' . esc_textarea($edutxt1) . '</textarea></td>
    </tr>';
    echo '</table>';

}

function addedutxt1Hook(){
     add_meta_box('edutxt1', __('Education Text 1', 'luzuk-premium'), 'edutxt1CutomFieldHtml', 'our-experiences', 'normal', 'high');
}

function saveedutxt1CutomData($post_id){
    // If it is our form has not been submitted, so we dont want to do anything
    if(defined('DOING_AUTOSAVE') && DOING_AUTOSAVE)
        return;
     if (isset($_POST['edutxt1'])) {

    $edutxt1 = $_POST['edutxt1'];
    update_post_meta($post_id, 'edutxt1', $edutxt1);
    
    }
}
add_action('add_meta_boxes', 'addedutxt1Hook');
add_action('save_post', 'saveedutxt1CutomData');

// ****end********

//Education Year  2
function eduRbxnum2CutomFieldHtml(){
    global $post;
    // get the saved value 
    $eduRbxnum2 = get_post_meta($post->ID, 'eduRbxnum2', false);
    $eduRbxnum2 = !empty($eduRbxnum2[0])?$eduRbxnum2[0]:'';

    // Use nonce for verification
    wp_nonce_field(plugin_basename(__FILE__), ' ');
    echo '<table id="sliderbtntext" width="100%">';
    echo '<tr> 
    <th width="10%"><span class="dashicons dashicons-edit-large"></span></th>
    <td width="90%"><input type="text" name="eduRbxnum2" width="100%" placeholder="Number" value="'.$eduRbxnum2.'" /></td>
    </tr>';
    echo '</table>';

}

function addeduRbxnum2Hook(){
     add_meta_box('eduRbxnum2', __(' Education Year 2', 'luzuk-premium'), 'eduRbxnum2CutomFieldHtml', 'our-experiences', 'normal', 'high');
}

function saveeduRbxnum2CutomData($post_id){
    // If it is our form has not been submitted, so we dont want to do anything
    if(defined('DOING_AUTOSAVE') && DOING_AUTOSAVE)
        return;
     if (isset($_POST['eduRbxnum2'])) {

    $eduRbxnum2 = $_POST['eduRbxnum2'];
    update_post_meta($post_id, 'eduRbxnum2', $eduRbxnum2);
    
    }
}
add_action('add_meta_boxes', 'addeduRbxnum2Hook');
add_action('save_post', 'saveeduRbxnum2CutomData');

// ****end********

//Education Title 2
function eduRbxtitle2CutomFieldHtml(){
    global $post;
    // get the saved value 
    $eduRbxtitle2 = get_post_meta($post->ID, 'eduRbxtitle2', false);
    $eduRbxtitle2 = !empty($eduRbxtitle2[0])?$eduRbxtitle2[0]:'';

    // Use nonce for verification
    wp_nonce_field(plugin_basename(__FILE__), ' ');
    echo '<table id="sliderbtntext" width="100%">';
    echo '<tr> 
    <th width="10%"><span class="dashicons dashicons-edit-large"></span></th>
    <td width="90%"><input type="text" name="eduRbxtitle2" width="100%" placeholder="Title" value="'.$eduRbxtitle2.'" /></td>
    </tr>';
    echo '</table>';

}

function addeduRbxtitle2Hook(){
     add_meta_box('eduRbxtitle2', __(' Education Title 2', 'luzuk-premium'), 'eduRbxtitle2CutomFieldHtml', 'our-experiences', 'normal', 'high');
}

function saveeduRbxtitle2CutomData($post_id){
    // If it is our form has not been submitted, so we dont want to do anything
    if(defined('DOING_AUTOSAVE') && DOING_AUTOSAVE)
        return;
     if (isset($_POST['eduRbxtitle2'])) {

    $eduRbxtitle2 = $_POST['eduRbxtitle2'];
    update_post_meta($post_id, 'eduRbxtitle2', $eduRbxtitle2);
    
    }
}
add_action('add_meta_boxes', 'addeduRbxtitle2Hook');
add_action('save_post', 'saveeduRbxtitle2CutomData');

// ****end********

//Nation Name 2
function edupost2CutomFieldHtml(){
    global $post;
    // get the saved value 
    $edupost2 = get_post_meta($post->ID, 'edupost2', false);
    $edupost2 = !empty($edupost2[0])?$edupost2[0]:'';

    // Use nonce for verification
    wp_nonce_field(plugin_basename(__FILE__), ' ');
    echo '<table id="sliderbtntext" width="100%">';
    echo '<tr> 
    <th width="10%"><span class="dashicons dashicons-edit-large"></span></th>
    <td width="90%"><input type="text" name="edupost2" width="100%" placeholder="Text" value="'.$edupost2.'" /></td>
    </tr>';
    echo '</table>';

}

function addedupost2Hook(){
     add_meta_box('edupost2', __(' Address 2', 'luzuk-premium'), 'edupost2CutomFieldHtml', 'our-experiences', 'normal', 'high');
}

function saveedupost2CutomData($post_id){
    // If it is our form has not been submitted, so we dont want to do anything
    if(defined('DOING_AUTOSAVE') && DOING_AUTOSAVE)
        return;
     if (isset($_POST['edupost2'])) {

    $edupost2 = $_POST['edupost2'];
    update_post_meta($post_id, 'edupost2', $edupost2);
    
    }
}
add_action('add_meta_boxes', 'addedupost2Hook');
add_action('save_post', 'saveedupost2CutomData');

// ****end********

//Edu Text 2
function edutxt2CutomFieldHtml(){
    global $post;
    // get the saved value 
    $edutxt2 = get_post_meta($post->ID, 'edutxt2', false);
    $edutxt2 = !empty($edutxt2[0])?$edutxt2[0]:'';

    // Use nonce for verification
    wp_nonce_field(plugin_basename(__FILE__), ' ');
    echo '<table id="sliderbtntext" width="100%">';
    echo '<tr> 
    <th width="10%"><span class="dashicons dashicons-edit-large"></span></th>
     <td width="90%"><textarea name="edutxt2" style="width: 100%;" placeholder="Text">' . esc_textarea($edutxt2) . '</textarea></td>
    </tr>';
    echo '</table>';

}

function addedutxt2Hook(){
     add_meta_box('edutxt2', __('Education Text 2', 'luzuk-premium'), 'edutxt2CutomFieldHtml', 'our-experiences', 'normal', 'high');
}

function saveedutxt2CutomData($post_id){
    // If it is our form has not been submitted, so we dont want to do anything
    if(defined('DOING_AUTOSAVE') && DOING_AUTOSAVE)
        return;
     if (isset($_POST['edutxt2'])) {

    $edutxt2 = $_POST['edutxt2'];
    update_post_meta($post_id, 'edutxt2', $edutxt2);
    
    }
}
add_action('add_meta_boxes', 'addedutxt2Hook');
add_action('save_post', 'saveedutxt2CutomData');

// ****end********

//Education Year 3
function eduRbxnum3CutomFieldHtml(){
    global $post;
    // get the saved value 
    $eduRbxnum3 = get_post_meta($post->ID, 'eduRbxnum3', false);
    $eduRbxnum3 = !empty($eduRbxnum3[0])?$eduRbxnum3[0]:'';

    // Use nonce for verification
    wp_nonce_field(plugin_basename(__FILE__), ' ');
    echo '<table id="sliderbtntext" width="100%">';
    echo '<tr> 
    <th width="10%"><span class="dashicons dashicons-edit-large"></span></th>
    <td width="90%"><input type="text" name="eduRbxnum3" width="100%" placeholder="Number" value="'.$eduRbxnum3.'" /></td>
    </tr>';
    echo '</table>';

}

function addeduRbxnum3Hook(){
     add_meta_box('eduRbxnum3', __(' Education Year 3', 'luzuk-premium'), 'eduRbxnum3CutomFieldHtml', 'our-experiences', 'normal', 'high');
}

function saveeduRbxnum3CutomData($post_id){
    // If it is our form has not been submitted, so we dont want to do anything
    if(defined('DOING_AUTOSAVE') && DOING_AUTOSAVE)
        return;
     if (isset($_POST['eduRbxnum3'])) {

    $eduRbxnum3 = $_POST['eduRbxnum3'];
    update_post_meta($post_id, 'eduRbxnum3', $eduRbxnum3);
    
    }
}
add_action('add_meta_boxes', 'addeduRbxnum3Hook');
add_action('save_post', 'saveeduRbxnum3CutomData');

// ****end********

//Education Title 3
function eduRbxtitle3CutomFieldHtml(){
    global $post;
    // get the saved value 
    $eduRbxtitle3 = get_post_meta($post->ID, 'eduRbxtitle3', false);
    $eduRbxtitle3 = !empty($eduRbxtitle3[0])?$eduRbxtitle3[0]:'';

    // Use nonce for verification
    wp_nonce_field(plugin_basename(__FILE__), ' ');
    echo '<table id="sliderbtntext" width="100%">';
    echo '<tr> 
    <th width="10%"><span class="dashicons dashicons-edit-large"></span></th>
    <td width="90%"><input type="text" name="eduRbxtitle3" width="100%" placeholder="Title" value="'.$eduRbxtitle3.'" /></td>
    </tr>';
    echo '</table>';

}

function addeduRbxtitle3Hook(){
     add_meta_box('eduRbxtitle3', __(' Education Title 3', 'luzuk-premium'), 'eduRbxtitle3CutomFieldHtml', 'our-experiences', 'normal', 'high');
}

function saveeduRbxtitle3CutomData($post_id){
    // If it is our form has not been submitted, so we dont want to do anything
    if(defined('DOING_AUTOSAVE') && DOING_AUTOSAVE)
        return;
     if (isset($_POST['eduRbxtitle3'])) {

    $eduRbxtitle3 = $_POST['eduRbxtitle3'];
    update_post_meta($post_id, 'eduRbxtitle3', $eduRbxtitle3);
    
    }
}
add_action('add_meta_boxes', 'addeduRbxtitle3Hook');
add_action('save_post', 'saveeduRbxtitle3CutomData');

// ****end********

//Nation Name 3
function edupost3CutomFieldHtml(){
    global $post;
    // get the saved value 
    $edupost3 = get_post_meta($post->ID, 'edupost3', false);
    $edupost3 = !empty($edupost3[0])?$edupost3[0]:'';

    // Use nonce for verification
    wp_nonce_field(plugin_basename(__FILE__), ' ');
    echo '<table id="sliderbtntext" width="100%">';
    echo '<tr> 
    <th width="10%"><span class="dashicons dashicons-edit-large"></span></th>
    <td width="90%"><input type="text" name="edupost3" width="100%" placeholder="Text" value="'.$edupost3.'" /></td>
    </tr>';
    echo '</table>';

}

function addedupost3Hook(){
     add_meta_box('edupost3', __(' Address 3', 'luzuk-premium'), 'edupost3CutomFieldHtml', 'our-experiences', 'normal', 'high');
}

function saveedupost3CutomData($post_id){
    // If it is our form has not been submitted, so we dont want to do anything
    if(defined('DOING_AUTOSAVE') && DOING_AUTOSAVE)
        return;
     if (isset($_POST['edupost3'])) {

    $edupost3 = $_POST['edupost3'];
    update_post_meta($post_id, 'edupost3', $edupost3);
    
    }
}
add_action('add_meta_boxes', 'addedupost3Hook');
add_action('save_post', 'saveedupost3CutomData');

// ****end********

//Edu Text 3
function edutxt3CutomFieldHtml(){
    global $post;
    // get the saved value 
    $edutxt3 = get_post_meta($post->ID, 'edutxt3', false);
    $edutxt3 = !empty($edutxt3[0])?$edutxt3[0]:'';

    // Use nonce for verification
    wp_nonce_field(plugin_basename(__FILE__), ' ');
    echo '<table id="sliderbtntext" width="100%">';
    echo '<tr> 
    <th width="10%"><span class="dashicons dashicons-edit-large"></span></th>
     <td width="90%"><textarea name="edutxt3" style="width: 100%;" placeholder="Text">' . esc_textarea($edutxt3) . '</textarea></td>
    </tr>';
    echo '</table>';

}

function addedutxt3Hook(){
     add_meta_box('edutxt3', __('Education Text 3', 'luzuk-premium'), 'edutxt3CutomFieldHtml', 'our-experiences', 'normal', 'high');
}

function saveedutxt3CutomData($post_id){
    // If it is our form has not been submitted, so we dont want to do anything
    if(defined('DOING_AUTOSAVE') && DOING_AUTOSAVE)
        return;
     if (isset($_POST['edutxt3'])) {

    $edutxt3 = $_POST['edutxt3'];
    update_post_meta($post_id, 'edutxt3', $edutxt3);
    
    }
}
add_action('add_meta_boxes', 'addedutxt3Hook');
add_action('save_post', 'saveedutxt3CutomData');

// ****end********

// ****************************
// skill 

// knowlege skill title
function ktitleCutomFieldHtml(){
    global $post;
    // get the saved value 
    $ktitle = get_post_meta($post->ID, 'ktitle', false);
    $ktitle = !empty($ktitle[0])?$ktitle[0]:'';

    // Use nonce for verification
    wp_nonce_field(plugin_basename(__FILE__), ' ');
    echo '<table id="sliderbtntext" width="100%">';
    echo '<tr> 
    <th width="10%"><span class="dashicons dashicons-edit-large"></span></th>
    <td width="90%"><input type="text" name="ktitle" width="100%" placeholder="Left Box Title Here" value="'.$ktitle.'" /></td>
    </tr>';
    echo '</table>';

}

function addktitleHook(){
     add_meta_box('ktitle', __('Add Left Box Title', 'luzuk-premium'), 'ktitleCutomFieldHtml', 'our-skills', 'normal', 'high');
}

function savektitleCutomData($post_id){
    // If it is our form has not been submitted, so we dont want to do anything
    if(defined('DOING_AUTOSAVE') && DOING_AUTOSAVE)
        return;
     if (isset($_POST['ktitle'])) {

    $ktitle = $_POST['ktitle'];
    update_post_meta($post_id, 'ktitle', $ktitle);
    
    }
}
add_action('add_meta_boxes', 'addktitleHook');
add_action('save_post', 'savektitleCutomData');

// ****end********


// knowlege skill text
function ktxtCutomFieldHtml(){
    global $post;
    // get the saved value 
    $ktxt = get_post_meta($post->ID, 'ktxt', false);
    $ktxt = !empty($ktxt[0])?$ktxt[0]:'';

    // Use nonce for verification
    wp_nonce_field(plugin_basename(__FILE__), ' ');
    echo '<table id="sliderbtntext" width="100%">';
    echo '<tr> 
    <th width="10%"><span class="dashicons dashicons-edit-large"></span></th>
    <td width="90%">
    <textarea name="ktxt" rows="5" style="width: 100%;" placeholder="Left Box Text Here">' . esc_textarea($ktxt) . '</textarea>
    </td>
    </tr>';
    echo '</table>';

}

function addktxtHook(){
     add_meta_box('ktxt', __('Add Left Box Text', 'luzuk-premium'), 'ktxtCutomFieldHtml', 'our-skills', 'normal', 'high');
}

function savektxtCutomData($post_id){
    // If it is our form has not been submitted, so we dont want to do anything
    if(defined('DOING_AUTOSAVE') && DOING_AUTOSAVE)
        return;
     if (isset($_POST['ktxt'])) {

    $ktxt = $_POST['ktxt'];
    update_post_meta($post_id, 'ktxt', $ktxt);
    
    }
}
add_action('add_meta_boxes', 'addktxtHook');
add_action('save_post', 'savektxtCutomData');

// ****end********

// coding skill title
function ctitleCutomFieldHtml(){
    global $post;
    // get the saved value 
    $ctitle = get_post_meta($post->ID, 'ctitle', false);
    $ctitle = !empty($ctitle[0])?$ctitle[0]:'';

    // Use nonce for verification
    wp_nonce_field(plugin_basename(__FILE__), ' ');
    echo '<table id="sliderbtntext" width="100%">';
    echo '<tr> 
    <th width="10%"><span class="dashicons dashicons-edit-large"></span></th>
    <td width="90%"><input type="text" name="ctitle" width="100%" placeholder="Right Box Title Here" value="'.$ctitle.'" /></td>
    </tr>';
    echo '</table>';

}

function addctitleHook(){
     add_meta_box('ctitle', __('Add Right Box Title', 'luzuk-premium'), 'ctitleCutomFieldHtml', 'our-skills', 'normal', 'high');
}

function savectitleCutomData($post_id){
    // If it is our form has not been submitted, so we dont want to do anything
    if(defined('DOING_AUTOSAVE') && DOING_AUTOSAVE)
        return;
     if (isset($_POST['ctitle'])) {

    $ctitle = $_POST['ctitle'];
    update_post_meta($post_id, 'ctitle', $ctitle);
    
    }
}
add_action('add_meta_boxes', 'addctitleHook');
add_action('save_post', 'savectitleCutomData');

// ******end******

// coding skill text
function ctxtCutomFieldHtml() {
    global $post;
    // Get the saved value
    $ctxt = get_post_meta($post->ID, 'ctxt', true); // Use `true` for single value retrieval
    $ctxt = !empty($ctxt) ? $ctxt : '';

    // Use nonce for verification
    wp_nonce_field(plugin_basename(__FILE__), 'ctxt_nonce');
    
    // Create a larger text area
    echo '<table id="sliderbtntext" width="100%">';
    echo '<tr> 
            <th width="10%"><span class="dashicons dashicons-edit-large"></span></th>
            <td width="90%">
                <textarea name="ctxt" rows="5" style="width: 100%;" placeholder="Right Box Text Here">' . esc_textarea($ctxt) . '</textarea>
            </td>
          </tr>';
    echo '</table>';
}

function addctxtHook() {
    add_meta_box(
        'ctxt',
        __('Add Right Box Text', 'luzuk-premium'),
        'ctxtCutomFieldHtml',
        'our-skills',
        'normal',
        'high'
    );
}

function savectxtCutomData($post_id) {
    // Check for autosave
    if (defined('DOING_AUTOSAVE') && DOING_AUTOSAVE) {
        return;
    }

    // Verify nonce
    if (!isset($_POST['ctxt_nonce']) || !wp_verify_nonce($_POST['ctxt_nonce'], plugin_basename(__FILE__))) {
        return;
    }

    // Save the data
    if (isset($_POST['ctxt'])) {
        $ctxt = sanitize_textarea_field($_POST['ctxt']);
        update_post_meta($post_id, 'ctxt', $ctxt);
    }
}

add_action('add_meta_boxes', 'addctxtHook');
add_action('save_post', 'savectxtCutomData');

// ******end******
// Progress Bar Custom Fields

// List 1 Title
function ptxt1CustomFieldHtml() {
    global $post;
    // Get the saved value
    $ptxt1 = get_post_meta($post->ID, 'ptxt1', true);
    $ptxt1 = !empty($ptxt1) ? esc_attr($ptxt1) : '';

    // Use nonce for verification
    wp_nonce_field('ptxt1_nonce_action', 'ptxt1_nonce_field');

    echo '<table id="sliderbtntext" width="100%">';
    echo '<tr> 
        <th width="10%"><span class="dashicons dashicons-edit-large"></span></th>
        <td width="90%"><input type="text" name="ptxt1" style="width:200px" placeholder="Progress Bar Title 1" value="' . $ptxt1 . '" /></td>
    </tr>';
    echo '</table>';
}

function addPtxt1MetaBox() {
    add_meta_box(
        'ptxt1', 
        __('Progress Bar Title 1', 'luzuk-premium'), 
        'ptxt1CustomFieldHtml', 
        'our-skills', 
        'normal', 
        'high'
    );
}

function savePtxt1CustomData($post_id) {
    // Check if the nonce is valid
    if (!isset($_POST['ptxt1_nonce_field']) || !wp_verify_nonce($_POST['ptxt1_nonce_field'], 'ptxt1_nonce_action')) {
        return;
    }

    // Check autosave
    if (defined('DOING_AUTOSAVE') && DOING_AUTOSAVE) {
        return;
    }

    // Save the data
    if (isset($_POST['ptxt1'])) {
        $ptxt1 = sanitize_text_field($_POST['ptxt1']);
        update_post_meta($post_id, 'ptxt1', $ptxt1);
    }
}

add_action('add_meta_boxes', 'addPtxt1MetaBox');
add_action('save_post', 'savePtxt1CustomData');

// *********end***********

//01
// List 1 Percentage
function ptxtPer1CustomFieldHtml() {
    global $post;
    // Get the saved value
    $ptxtper1 = get_post_meta($post->ID, 'ptxtper1', true);
    $ptxtper1 = !empty($ptxtper1) ? esc_attr($ptxtper1) : '';

    // Use nonce for verification
    wp_nonce_field('ptxtper1_nonce_action', 'ptxtper1_nonce_field');

    echo '<table id="sliderbtntext" width="100%">';
    echo '<tr> 
        <th width="10%"><span class="dashicons dashicons-edit-large"></span></th>
        <td width="90%"><input type="text" name="ptxtper1" style="width:200px" placeholder="Title Percent 1" value="' . $ptxtper1 . '" /></td>
    </tr>';
    echo '</table>';
}

function addPtxtPer1MetaBox() {
    add_meta_box(
        'ptxtper1', 
        __('Progress Bar Title Percent 1', 'luzuk-premium'), 
        'ptxtPer1CustomFieldHtml', 
        'our-skills', 
        'normal', 
        'high'
    );
}

function savePtxtPer1CustomData($post_id) {
    // Check if the nonce is valid
    if (!isset($_POST['ptxtper1_nonce_field']) || !wp_verify_nonce($_POST['ptxtper1_nonce_field'], 'ptxtper1_nonce_action')) {
        return;
    }

    // Check autosave
    if (defined('DOING_AUTOSAVE') && DOING_AUTOSAVE) {
        return;
    }

    // Save the data
    if (isset($_POST['ptxtper1'])) {
        $ptxtper1 = intval($_POST['ptxtper1']); // Ensure numeric value
        update_post_meta($post_id, 'ptxtper1', $ptxtper1);
    }
}

add_action('add_meta_boxes', 'addPtxtPer1MetaBox');
add_action('save_post', 'savePtxtPer1CustomData');

// ********** end ************

// 02
// List  Title 2
function ptxt2CustomFieldHtml() {
    global $post;
    // Get the saved value
    $ptxt2 = get_post_meta($post->ID, 'ptxt2', true);
    $ptxt2 = !empty($ptxt2) ? esc_attr($ptxt2) : '';

    // Use nonce for verification
    wp_nonce_field('ptxt2_nonce_action', 'ptxt2_nonce_field');

    echo '<table id="sliderbtntext" width="100%">';
    echo '<tr> 
        <th width="10%"><span class="dashicons dashicons-edit-large"></span></th>
        <td width="90%"><input type="text" name="ptxt2" style="width:200px" placeholder="Progress Bar Title 2" value="' . $ptxt2 . '" /></td>
    </tr>';
    echo '</table>';
}

function addptxt2MetaBox() {
    add_meta_box(
        'ptxt2', 
        __('Progress Bar Title 2', 'luzuk-premium'), 
        'ptxt2CustomFieldHtml', 
        'our-skills', 
        'normal', 
        'high'
    );
}

function saveptxt2CustomData($post_id) {
    // Check if the nonce is valid
    if (!isset($_POST['ptxt2_nonce_field']) || !wp_verify_nonce($_POST['ptxt2_nonce_field'], 'ptxt2_nonce_action')) {
        return;
    }

    // Check autosave
    if (defined('DOING_AUTOSAVE') && DOING_AUTOSAVE) {
        return;
    }

    // Save the data
    if (isset($_POST['ptxt2'])) {
        $ptxt2 = sanitize_text_field($_POST['ptxt2']);
        update_post_meta($post_id, 'ptxt2', $ptxt2);
    }
}

add_action('add_meta_boxes', 'addptxt2MetaBox');
add_action('save_post', 'saveptxt2CustomData');

// *********end***********

// List Percentage 2
function ptxtper2CustomFieldHtml() {
    global $post;
    // Get the saved value
    $ptxtper2 = get_post_meta($post->ID, 'ptxtper2', true);
    $ptxtper2 = !empty($ptxtper2) ? esc_attr($ptxtper2) : '';

    // Use nonce for verification
    wp_nonce_field('ptxtper2_nonce_action', 'ptxtper2_nonce_field');

    echo '<table id="sliderbtntext" width="100%">';
    echo '<tr> 
        <th width="10%"><span class="dashicons dashicons-edit-large"></span></th>
        <td width="90%"><input type="text" name="ptxtper2" style="width:200px" placeholder="Title Percent 2" value="' . $ptxtper2 . '" /></td>
    </tr>';
    echo '</table>';
}

function addptxtper2MetaBox() {
    add_meta_box(
        'ptxtper2', 
        __('Progress Bar Title Percent 2', 'luzuk-premium'), 
        'ptxtper2CustomFieldHtml', 
        'our-skills', 
        'normal', 
        'high'
    );
}

function saveptxtper2CustomData($post_id) {
    // Check if the nonce is valid
    if (!isset($_POST['ptxtper2_nonce_field']) || !wp_verify_nonce($_POST['ptxtper2_nonce_field'], 'ptxtper2_nonce_action')) {
        return;
    }

    // Check autosave
    if (defined('DOING_AUTOSAVE') && DOING_AUTOSAVE) {
        return;
    }

    // Save the data
    if (isset($_POST['ptxtper2'])) {
        $ptxtper2 = intval($_POST['ptxtper2']); // Ensure numeric value
        update_post_meta($post_id, 'ptxtper2', $ptxtper2);
    }
}

add_action('add_meta_boxes', 'addptxtper2MetaBox');
add_action('save_post', 'saveptxtper2CustomData');

// ********** end ************

//03
// List  Title 3
function ptxt3CustomFieldHtml() {
    global $post;
    // Get the saved value
    $ptxt3 = get_post_meta($post->ID, 'ptxt3', true);
    $ptxt3 = !empty($ptxt3) ? esc_attr($ptxt3) : '';

    // Use nonce for verification
    wp_nonce_field('ptxt3_nonce_action', 'ptxt3_nonce_field');

    echo '<table id="sliderbtntext" width="100%">';
    echo '<tr> 
        <th width="10%"><span class="dashicons dashicons-edit-large"></span></th>
        <td width="90%"><input type="text" name="ptxt3" style="width:200px" placeholder="Progress Bar Title 3" value="' . $ptxt3 . '" /></td>
    </tr>';
    echo '</table>';
}

function addptxt3MetaBox() {
    add_meta_box(
        'ptxt3', 
        __('Progress Bar Title 3', 'luzuk-premium'), 
        'ptxt3CustomFieldHtml', 
        'our-skills', 
        'normal', 
        'high'
    );
}

function saveptxt3CustomData($post_id) {
    // Check if the nonce is valid
    if (!isset($_POST['ptxt3_nonce_field']) || !wp_verify_nonce($_POST['ptxt3_nonce_field'], 'ptxt3_nonce_action')) {
        return;
    }

    // Check autosave
    if (defined('DOING_AUTOSAVE') && DOING_AUTOSAVE) {
        return;
    }

    // Save the data
    if (isset($_POST['ptxt3'])) {
        $ptxt3 = sanitize_text_field($_POST['ptxt3']);
        update_post_meta($post_id, 'ptxt3', $ptxt3);
    }
}

add_action('add_meta_boxes', 'addptxt3MetaBox');
add_action('save_post', 'saveptxt3CustomData');

// *********end***********

// List Percentage 3
function ptxtper3CustomFieldHtml() {
    global $post;
    // Get the saved value
    $ptxtper3 = get_post_meta($post->ID, 'ptxtper3', true);
    $ptxtper3 = !empty($ptxtper3) ? esc_attr($ptxtper3) : '';

    // Use nonce for verification
    wp_nonce_field('ptxtper3_nonce_action', 'ptxtper3_nonce_field');

    echo '<table id="sliderbtntext" width="100%">';
    echo '<tr> 
        <th width="10%"><span class="dashicons dashicons-edit-large"></span></th>
        <td width="90%"><input type="text" name="ptxtper3" style="width:200px" placeholder="Title Percent 3" value="' . $ptxtper3 . '" /></td>
    </tr>';
    echo '</table>';
}

function addptxtper3MetaBox() {
    add_meta_box(
        'ptxtper3', 
        __('Progress Bar Title Percent 3', 'luzuk-premium'), 
        'ptxtper3CustomFieldHtml', 
        'our-skills', 
        'normal', 
        'high'
    );
}

function saveptxtper3CustomData($post_id) {
    // Check if the nonce is valid
    if (!isset($_POST['ptxtper3_nonce_field']) || !wp_verify_nonce($_POST['ptxtper3_nonce_field'], 'ptxtper3_nonce_action')) {
        return;
    }

    // Check autosave
    if (defined('DOING_AUTOSAVE') && DOING_AUTOSAVE) {
        return;
    }

    // Save the data
    if (isset($_POST['ptxtper3'])) {
        $ptxtper3 = intval($_POST['ptxtper3']); // Ensure numeric value
        update_post_meta($post_id, 'ptxtper3', $ptxtper3);
    }
}

add_action('add_meta_boxes', 'addptxtper3MetaBox');
add_action('save_post', 'saveptxtper3CustomData');

// ********** end ************

//04
// List  Title 4
function ptxt4CustomFieldHtml() {
    global $post;
    // Get the saved value
    $ptxt4 = get_post_meta($post->ID, 'ptxt4', true);
    $ptxt4 = !empty($ptxt4) ? esc_attr($ptxt4) : '';

    // Use nonce for verification
    wp_nonce_field('ptxt4_nonce_action', 'ptxt4_nonce_field');

    echo '<table id="sliderbtntext" width="100%">';
    echo '<tr> 
        <th width="10%"><span class="dashicons dashicons-edit-large"></span></th>
        <td width="90%"><input type="text" name="ptxt4" style="width:200px" placeholder="Progress Bar Title 4" value="' . $ptxt4 . '" /></td>
    </tr>';
    echo '</table>';
}

function addptxt4MetaBox() {
    add_meta_box(
        'ptxt4', 
        __('Progress Bar Title 4', 'luzuk-premium'), 
        'ptxt4CustomFieldHtml', 
        'our-skills', 
        'normal', 
        'high'
    );
}

function saveptxt4CustomData($post_id) {
    // Check if the nonce is valid
    if (!isset($_POST['ptxt4_nonce_field']) || !wp_verify_nonce($_POST['ptxt4_nonce_field'], 'ptxt4_nonce_action')) {
        return;
    }

    // Check autosave
    if (defined('DOING_AUTOSAVE') && DOING_AUTOSAVE) {
        return;
    }

    // Save the data
    if (isset($_POST['ptxt4'])) {
        $ptxt4 = sanitize_text_field($_POST['ptxt4']);
        update_post_meta($post_id, 'ptxt4', $ptxt4);
    }
}

add_action('add_meta_boxes', 'addptxt4MetaBox');
add_action('save_post', 'saveptxt4CustomData');

// *********end***********

// List Percentage 4
function ptxtper4CustomFieldHtml() {
    global $post;
    // Get the saved value
    $ptxtper4 = get_post_meta($post->ID, 'ptxtper4', true);
    $ptxtper4 = !empty($ptxtper4) ? esc_attr($ptxtper4) : '';

    // Use nonce for verification
    wp_nonce_field('ptxtper4_nonce_action', 'ptxtper4_nonce_field');

    echo '<table id="sliderbtntext" width="100%">';
    echo '<tr> 
        <th width="10%"><span class="dashicons dashicons-edit-large"></span></th>
        <td width="90%"><input type="text" name="ptxtper4" style="width:200px" placeholder="Title Percent 4" value="' . $ptxtper4 . '" /></td>
    </tr>';
    echo '</table>';
}

function addptxtper4MetaBox() {
    add_meta_box(
        'ptxtper4', 
        __('Progress Bar Title Percent 4', 'luzuk-premium'), 
        'ptxtper4CustomFieldHtml', 
        'our-skills', 
        'normal', 
        'high'
    );
}

function saveptxtper4CustomData($post_id) {
    // Check if the nonce is valid
    if (!isset($_POST['ptxtper4_nonce_field']) || !wp_verify_nonce($_POST['ptxtper4_nonce_field'], 'ptxtper4_nonce_action')) {
        return;
    }

    // Check autosave
    if (defined('DOING_AUTOSAVE') && DOING_AUTOSAVE) {
        return;
    }

    // Save the data
    if (isset($_POST['ptxtper4'])) {
        $ptxtper4 = intval($_POST['ptxtper4']); // Ensure numeric value
        update_post_meta($post_id, 'ptxtper4', $ptxtper4);
    }
}

add_action('add_meta_boxes', 'addptxtper4MetaBox');
add_action('save_post', 'saveptxtper4CustomData');

// ********** end ************

//05
// List  Title 5
function ptxt5CustomFieldHtml() {
    global $post;
    // Get the saved value
    $ptxt5 = get_post_meta($post->ID, 'ptxt5', true);
    $ptxt5 = !empty($ptxt5) ? esc_attr($ptxt5) : '';

    // Use nonce for verification
    wp_nonce_field('ptxt5_nonce_action', 'ptxt5_nonce_field');

    echo '<table id="sliderbtntext" width="100%">';
    echo '<tr> 
        <th width="10%"><span class="dashicons dashicons-edit-large"></span></th>
        <td width="90%"><input type="text" name="ptxt5" style="width:200px" placeholder="Progress Bar Title 5" value="' . $ptxt5 . '" /></td>
    </tr>';
    echo '</table>';
}

function addptxt5MetaBox() {
    add_meta_box(
        'ptxt5', 
        __('Progress Bar Title 5', 'luzuk-premium'), 
        'ptxt5CustomFieldHtml', 
        'our-skills', 
        'normal', 
        'high'
    );
}

function saveptxt5CustomData($post_id) {
    // Check if the nonce is valid
    if (!isset($_POST['ptxt5_nonce_field']) || !wp_verify_nonce($_POST['ptxt5_nonce_field'], 'ptxt5_nonce_action')) {
        return;
    }

    // Check autosave
    if (defined('DOING_AUTOSAVE') && DOING_AUTOSAVE) {
        return;
    }

    // Save the data
    if (isset($_POST['ptxt5'])) {
        $ptxt5 = sanitize_text_field($_POST['ptxt5']);
        update_post_meta($post_id, 'ptxt5', $ptxt5);
    }
}

add_action('add_meta_boxes', 'addptxt5MetaBox');
add_action('save_post', 'saveptxt5CustomData');

// *********end***********

// List Percentage 5
function ptxtper5CustomFieldHtml() {
    global $post;
    // Get the saved value
    $ptxtper5 = get_post_meta($post->ID, 'ptxtper5', true);
    $ptxtper5 = !empty($ptxtper5) ? esc_attr($ptxtper5) : '';

    // Use nonce for verification
    wp_nonce_field('ptxtper5_nonce_action', 'ptxtper5_nonce_field');

    echo '<table id="sliderbtntext" width="100%">';
    echo '<tr> 
        <th width="10%"><span class="dashicons dashicons-edit-large"></span></th>
        <td width="90%"><input type="text" name="ptxtper5" style="width:200px" placeholder="Title Percent 5" value="' . $ptxtper5 . '" /></td>
    </tr>';
    echo '</table>';
}

function addptxtper5MetaBox() {
    add_meta_box(
        'ptxtper5', 
        __('Progress Bar Title Percent 5', 'luzuk-premium'), 
        'ptxtper5CustomFieldHtml', 
        'our-skills', 
        'normal', 
        'high'
    );
}

function saveptxtper5CustomData($post_id) {
    // Check if the nonce is valid
    if (!isset($_POST['ptxtper5_nonce_field']) || !wp_verify_nonce($_POST['ptxtper5_nonce_field'], 'ptxtper5_nonce_action')) {
        return;
    }

    // Check autosave
    if (defined('DOING_AUTOSAVE') && DOING_AUTOSAVE) {
        return;
    }

    // Save the data
    if (isset($_POST['ptxtper5'])) {
        $ptxtper5 = intval($_POST['ptxtper5']); // Ensure numeric value
        update_post_meta($post_id, 'ptxtper5', $ptxtper5);
    }
}

add_action('add_meta_boxes', 'addptxtper5MetaBox');
add_action('save_post', 'saveptxtper5CustomData');

// ********** end ************

//06
// List  Title 6
function ptxt6CustomFieldHtml() {
    global $post;
    // Get the saved value
    $ptxt6 = get_post_meta($post->ID, 'ptxt6', true);
    $ptxt6 = !empty($ptxt6) ? esc_attr($ptxt6) : '';

    // Use nonce for verification
    wp_nonce_field('ptxt6_nonce_action', 'ptxt6_nonce_field');

    echo '<table id="sliderbtntext" width="100%">';
    echo '<tr> 
        <th width="10%"><span class="dashicons dashicons-edit-large"></span></th>
        <td width="90%"><input type="text" name="ptxt6" style="width:200px" placeholder="Progress Bar Title 6" value="' . $ptxt6 . '" /></td>
    </tr>';
    echo '</table>';
}

function addptxt6MetaBox() {
    add_meta_box(
        'ptxt6', 
        __('Progress Bar Title 6', 'luzuk-premium'), 
        'ptxt6CustomFieldHtml', 
        'our-skills', 
        'normal', 
        'high'
    );
}

function saveptxt6CustomData($post_id) {
    // Check if the nonce is valid
    if (!isset($_POST['ptxt6_nonce_field']) || !wp_verify_nonce($_POST['ptxt6_nonce_field'], 'ptxt6_nonce_action')) {
        return;
    }

    // Check autosave
    if (defined('DOING_AUTOSAVE') && DOING_AUTOSAVE) {
        return;
    }

    // Save the data
    if (isset($_POST['ptxt6'])) {
        $ptxt6 = sanitize_text_field($_POST['ptxt6']);
        update_post_meta($post_id, 'ptxt6', $ptxt6);
    }
}

add_action('add_meta_boxes', 'addptxt6MetaBox');
add_action('save_post', 'saveptxt6CustomData');

// *********end***********

// List Percentage 6
function ptxtper6CustomFieldHtml() {
    global $post;
    // Get the saved value
    $ptxtper6 = get_post_meta($post->ID, 'ptxtper6', true);
    $ptxtper6 = !empty($ptxtper6) ? esc_attr($ptxtper6) : '';

    // Use nonce for verification
    wp_nonce_field('ptxtper6_nonce_action', 'ptxtper6_nonce_field');

    echo '<table id="sliderbtntext" width="100%">';
    echo '<tr> 
        <th width="10%"><span class="dashicons dashicons-edit-large"></span></th>
        <td width="90%"><input type="text" name="ptxtper6" style="width:200px" placeholder="Title Percent 6" value="' . $ptxtper6 . '" /></td>
    </tr>';
    echo '</table>';
}

function addptxtper6MetaBox() {
    add_meta_box(
        'ptxtper6', 
        __('Progress Bar Title Percent 6', 'luzuk-premium'), 
        'ptxtper6CustomFieldHtml', 
        'our-skills', 
        'normal', 
        'high'
    );
}

function saveptxtper6CustomData($post_id) {
    // Check if the nonce is valid
    if (!isset($_POST['ptxtper6_nonce_field']) || !wp_verify_nonce($_POST['ptxtper6_nonce_field'], 'ptxtper6_nonce_action')) {
        return;
    }

    // Check autosave
    if (defined('DOING_AUTOSAVE') && DOING_AUTOSAVE) {
        return;
    }

    // Save the data
    if (isset($_POST['ptxtper6'])) {
        $ptxtper6 = intval($_POST['ptxtper6']); // Ensure numeric value
        update_post_meta($post_id, 'ptxtper6', $ptxtper6);
    }
}

add_action('add_meta_boxes', 'addptxtper6MetaBox');
add_action('save_post', 'saveptxtper6CustomData');

// ********** end ************

//07
// List  Title 7
function ptxt7CustomFieldHtml() {
    global $post;
    // Get the saved value
    $ptxt7 = get_post_meta($post->ID, 'ptxt7', true);
    $ptxt7 = !empty($ptxt7) ? esc_attr($ptxt7) : '';

    // Use nonce for verification
    wp_nonce_field('ptxt7_nonce_action', 'ptxt7_nonce_field');

    echo '<table id="sliderbtntext" width="100%">';
    echo '<tr> 
        <th width="10%"><span class="dashicons dashicons-edit-large"></span></th>
        <td width="90%"><input type="text" name="ptxt7" style="width:200px" placeholder="Progress Bar Title 7" value="' . $ptxt7 . '" /></td>
    </tr>';
    echo '</table>';
}

function addptxt7MetaBox() {
    add_meta_box(
        'ptxt7', 
        __('Progress Bar Title 7', 'luzuk-premium'), 
        'ptxt7CustomFieldHtml', 
        'our-skills', 
        'normal', 
        'high'
    );
}

function saveptxt7CustomData($post_id) {
    // Check if the nonce is valid
    if (!isset($_POST['ptxt7_nonce_field']) || !wp_verify_nonce($_POST['ptxt7_nonce_field'], 'ptxt7_nonce_action')) {
        return;
    }

    // Check autosave
    if (defined('DOING_AUTOSAVE') && DOING_AUTOSAVE) {
        return;
    }

    // Save the data
    if (isset($_POST['ptxt7'])) {
        $ptxt7 = sanitize_text_field($_POST['ptxt7']);
        update_post_meta($post_id, 'ptxt7', $ptxt7);
    }
}

add_action('add_meta_boxes', 'addptxt7MetaBox');
add_action('save_post', 'saveptxt7CustomData');

// *********end***********

// List Percentage 7
function ptxtper7CustomFieldHtml() {
    global $post;
    // Get the saved value
    $ptxtper7 = get_post_meta($post->ID, 'ptxtper7', true);
    $ptxtper7 = !empty($ptxtper7) ? esc_attr($ptxtper7) : '';

    // Use nonce for verification
    wp_nonce_field('ptxtper7_nonce_action', 'ptxtper7_nonce_field');

    echo '<table id="sliderbtntext" width="100%">';
    echo '<tr> 
        <th width="10%"><span class="dashicons dashicons-edit-large"></span></th>
        <td width="90%"><input type="text" name="ptxtper7" style="width:200px" placeholder="Title Percent 7" value="' . $ptxtper7 . '" /></td>
    </tr>';
    echo '</table>';
}

function addptxtper7MetaBox() {
    add_meta_box(
        'ptxtper7', 
        __('Progress Bar Title Percent 7', 'luzuk-premium'), 
        'ptxtper7CustomFieldHtml', 
        'our-skills', 
        'normal', 
        'high'
    );
}

function saveptxtper7CustomData($post_id) {
    // Check if the nonce is valid
    if (!isset($_POST['ptxtper7_nonce_field']) || !wp_verify_nonce($_POST['ptxtper7_nonce_field'], 'ptxtper7_nonce_action')) {
        return;
    }

    // Check autosave
    if (defined('DOING_AUTOSAVE') && DOING_AUTOSAVE) {
        return;
    }

    // Save the data
    if (isset($_POST['ptxtper7'])) {
        $ptxtper7 = intval($_POST['ptxtper7']); // Ensure numeric value
        update_post_meta($post_id, 'ptxtper7', $ptxtper7);
    }
}

add_action('add_meta_boxes', 'addptxtper7MetaBox');
add_action('save_post', 'saveptxtper7CustomData');

// *********end***********


/***** Start Add custome fields for team section *****/
/**
 * Method to save the custom field for the team posts 
 * When the post is saved, saves our custom data 
 * @author luzuk <support@luzuk.com>
 * @since V 1.1  09th Oct 2017
 **/
function teamSocialURLsCutomFieldHtml(){
    global $post;
    // get the saved value 
    $teamFacebook = get_post_meta($post->ID, 'teamFacebook', false);
    $teamFacebookValue = !empty($teamFacebook[0])?$teamFacebook[0]:'';
    $teamTwitter = get_post_meta($post->ID, 'teamTwitter', false);
    $teamTwitterValue = !empty($teamTwitter[0])?$teamTwitter[0]:'';
    $teamInstagram = get_post_meta($post->ID, 'teamInstagram', false);
    $teamInstagramValue = !empty($teamInstagram[0])?$teamInstagram[0]:'';

    //$teamlinkedIn = get_post_meta($post->ID, 'teamlinkedIn', false);
   // $teamlinkedInValue = !empty($teamlinkedIn[0])?$teamlinkedIn[0]:'';

     $teamPinterest = get_post_meta($post->ID, 'teamPinterest', false);
    $teamPinterestValue = !empty($teamPinterest[0])?$teamPinterest[0]:'';

    // Use nonce for verification
    wp_nonce_field(plugin_basename(__FILE__), 'Team_social_media_links');
    echo '<table id="socialUrls" width="100%">';
    echo '<tr> 
    <th width="10%"><span class="dashicons dashicons-facebook"></span></th>
    <td width="90%"><input type="text" name="teamFacebook" width="100%" placeholder="Facebook URL" value="'.$teamFacebookValue.'" /></td>
    </tr>';
    echo '<tr> 
    <th><span class="dashicons dashicons-twitter"></span></th>
    <td><input type="text" name="teamTwitter" placeholder="Twitter URL" width="100%" value="'.$teamTwitterValue.'" /></td>
    </tr>';
   
    echo '<tr> 
    <th><span class="dashicons dashicons-smartphone"></span></th>
    <td><input type="text" name="teamInstagram" placeholder="Instagram URL" width="100%" value="'.$teamInstagramValue.'" /></td>
    </tr>';

    echo '<tr> 
    <th><span class="dashicons dashicons-editor-ltr"></span></th>
    <td><input type="text" name="teamPinterest" placeholder="Pinterest URL" width="100%" value="'.$teamPinterestValue.'" /></td>
    </tr>';

    // echo '<tr> 
    // <th><span class="dashicons dashicons-businessman"></span></th>
    // <td><input type="text" name="teamlinkedIn" placeholder="Linkedin URL" width="100%" value="'.$teamlinkedInValue.'" /></td>
    // </tr>';

    echo '</table>';
}

/**
 * Method to save the custom field for the slider posts 
 * When the post is saved, saves our custom data 
 * @author luzuk <support@luzuk.com>
 * @since V 1.1  09th Oct 2017
 **/
function teamDesignationCutomFieldHtml(){
    global $post;
    // get the saved value 
    $designation = get_post_meta($post->ID, 'designation', false);
    $designation = !empty($designation[0])?$designation[0]:'';

    // Use nonce for verification
    wp_nonce_field(plugin_basename(__FILE__), 'Team_social_media_links');
    echo '<table id="socialUrls" width="100%">';
    echo '<tr> 
    <th width="10%"><span class="dashicons dashicons-welcome-learn-more"></span></th>
    <td width="90%"><input type="text" name="designation" width="100%" placeholder="Designation" value="'.$designation.'" /></td>
    </tr>';
    echo '</table>';
}

function addTeamHook(){
    add_meta_box('luzuk-team-social', __('Add Social media links', 'luzuk'), 'teamSocialURLsCutomFieldHtml', 'our-team', 'normal', 'high');
    add_meta_box('luzuk-team-designation', __('Add Designation', 'luzuk'), 'teamDesignationCutomFieldHtml', 'our-team', 'normal', 'high');
}
/**
 * Method to save the custom field for the testimonial posts 
 * When the post is saved, saves our custom data 
 * @param integer $post_id - An id of the post 
 * @author luzuk <support@luzuk.com>
 * @since V 1.1  09th Oct 2017
 **/
function saveTeamSocialCutomData($post_id){
    // If it is our form has not been submitted, so we dont want to do anything
    if(defined('DOING_AUTOSAVE') && DOING_AUTOSAVE)
        return;
    if(empty($_POST['teamFacebook']) && empty($_POST['teamTwitter']) && empty($_POST['teamlinkedIn']) && empty($_POST['teamPinterest']) && empty($_POST['teamInstagram']) && empty($_POST['designation']) ){
        // echo 'empty --> '; exit;       
        return;
    }
    $teamFacebook = $_POST['teamFacebook'];
    update_post_meta($post_id, 'teamFacebook', $teamFacebook);
    $teamTwitter = $_POST['teamTwitter'];
    update_post_meta($post_id, 'teamTwitter', $teamTwitter);
    // $teamGPlus = $_POST['teamGPlus'];
    // update_post_meta($post_id, 'teamGPlus', $teamGPlus);
    $teamInstagram = $_POST['teamInstagram'];
    update_post_meta($post_id, 'teamInstagram', $teamInstagram);

    $teamlinkedIn = $_POST['teamlinkedIn'];
    update_post_meta($post_id, 'teamlinkedIn', $teamlinkedIn);


    $teamPinterest = $_POST['teamPinterest'];
    update_post_meta($post_id, 'teamPinterest', $teamPinterest);

    $designation = $_POST['designation'];
    update_post_meta($post_id, 'designation', $designation);
}
add_action('add_meta_boxes', 'addTeamHook');
add_action('save_post', 'saveTeamSocialCutomData');
/***** End Add custome fields for team section *****/
/**
 * Method to save the custom field for the slider posts 
 * When the post is saved, saves our custom data 
 * @author luzuk <support@luzuk.com>
 * @since V 1.1  09th Oct 2017
 **/
function testimonialCutomFieldHtml(){
    global $post;
    // get the saved value 
    $testimonialSubTitle = get_post_meta($post->ID, 'testimonial_Sub_Title', false);
    $value = !empty($testimonialSubTitle[0])?$testimonialSubTitle[0]:'';
    // Use nonce for verification
    wp_nonce_field(plugin_basename(__FILE__), 'Testimonial_sut_title');
    echo '<div class="rows"> 
        <div class="col-sm-3">Authors Designation</div>
        <div class="col-sm-9"><input type="text" name="testimonialSubTitle" placeholder="Designation" value="'.$value.'" /></div>
    </div>';
}
function addTestimonialHook(){
    add_meta_box('lz-finesss-sub-title', __('Add Designation', 'luzuk-premium'), 'testimonialCutomFieldHtml', 'our-testimonial', 'normal', 'high');
}
/**
 * Method to save the custom field for the testimonial posts 
 * When the post is saved, saves our custom data 
 * @param integer $post_id - An id of the post 
 * @author luzuk <support@luzuk.com>
 * @since V 1.1  09th Oct 2017
 **/
function saveTestimonialCutomData($post_id){
    // If it is our form has not been submitted, so we dont want to do anything
    if(defined('DOING_AUTOSAVE') && DOING_AUTOSAVE)
        return;
    if(empty($_POST['Testimonial_sut_title']))
        return;
    if(!wp_verify_nonce($_POST['Testimonial_sut_title'], plugin_basename(__FILE__)))
        return;
    $testimonial_Sub_Title = $_POST['testimonialSubTitle'];
    update_post_meta($post_id, 'testimonial_Sub_Title', $testimonial_Sub_Title);
}
add_action('add_meta_boxes', 'addTestimonialHook');
add_action('save_post', 'saveTestimonialCutomData');

/**
 * Method to save the custom field for the testimonial posts 
 * When the post is saved, saves our custom data 
 * @param integer $post_id - An id of the post 
 * @author luzuk <support@luzuk.com>
 * @since V 1.1  09th Oct 2017
 **/
function getFonts($list = false, $index = -1){
    $fonts = array(
        "'Archivo Narrow', sans-serif",
        "'Arial', sans-serif",
        "'Arimo', sans-serif",
        "'Alex Brush', cursive",
        "'Arvo', serif",
        "'Biryani', sans-serif", 
        "'Berkshire Swash', cursive",
        "'Bitter', serif",
        "'Comfortaa', cursive",
        "'Dancing Script', cursive",
        "'Dosis', sans-serif",
        "'Droid Serif', serif",
        "'EB Garamond', serif",
        "'Exo 2', sans-serif",
        "'Francois One', sans-serif",
        "'Germania One', cursive",
        "'Hammersmith One', sans-serif",
        "'Indie Flower', cursive",
        "'Jockey One', sans-serif",
        "'Laila', sans-serif",
        "'Lobster', cursive",
        "'Lato', sans-serif",
        "'Mulish', sans-serif",
        "'Muli', sans-serif",
        "'Montserrat', sans-serif",
        "'Montserrat Alternates', sans-serif",
        "'Nosifer', cursive",
        "'Oswald', sans-serif",
        "'Open Sans', sans-serif",
        "'Passion One', cursive",
        "'PT Sans Caption', sans-serif",
        "'PT Sans Narrow', sans-serif",
        "'PT Sans', sans-serif",
        "'Pacifico', cursive",
        "'Poppins', sans-serif",       
        "'Pontano Sans', sans-serif",
        "'Questrial', sans-serif",
        "'Raleway', sans-serif",
        "'Roboto Mono', monospace",
        "'Roboto Slab', serif",
        "'Roboto', sans-serif",
        "'Rubik', sans-serif",
        "'Space Grotesk', serif",
        "'Source Serif Pro', serif",
        "'Schoolbell', cursive",
        "'Titillium Web', sans-serif",
        "'Work Sans', sans-serif",
    );
    if($list == true){
        foreach ($fonts as $key => $value) {
            $fonts[$key] = str_replace("'", "", $value);
        }
        asort($fonts);
        return $fonts;
    }
    $len = count($fonts);
    if(is_integer($index) && $index >= 0 && $index < $len){
        return $fonts[$index];
    }else{
        return $fonts;
    }
}

/**
 * show the pagination for the custome or normal post types
 * @param object $customeQuery - An onject of a query post
 * @author luzuk <support@luzuk.com>
 * @since V 1.1  09th Nov 2017
 **/
function lzGetPagination($customQuery){
    if(!is_object($customQuery)){return false;}
    $total_pages = $customQuery->max_num_pages;
    $big = 999999999;
    $current_page = max(1, get_query_var('paged'));
    echo paginate_links(array(
        'base' => str_replace( $big, '%#%', esc_url( get_pagenum_link( $big ) ) ),
        'format' => '?paged=%#%',
        'current' => $current_page,
        'total' => $total_pages,    
    ));
}


/**
* WooCommerce Extra Feature
* --------------------------
*
* Change number of related products on product page
* Set your own value for 'posts_per_page'
*
*/ 

// Single product image gallery zoom and slider

add_action( 'after_setup_theme', 'yourtheme_setup' );

function yourtheme_setup() {
    add_theme_support( 'wc-product-gallery-zoom' );
    add_theme_support( 'wc-product-gallery-lightbox' );
    add_theme_support( 'wc-product-gallery-slider' );
    add_theme_support( 'woocommerce' );
}


add_filter( 'woocommerce_single_product_carousel_options', 'cuswoo_update_woo_flexslider_options' );
/** 
 * Filer WooCommerce Flexslider options - Add Navigation Arrows
 */
function cuswoo_update_woo_flexslider_options( $options ) {

    $options['directionNav'] = true;

    return $options;
}


add_action('admin_menu', 'luzuk_lite_reorder_appearance_menu', 999);

function luzuk_lite_reorder_appearance_menu() {
    global $submenu;

    if (isset($submenu['themes.php'])) {
        $themes_submenu = $submenu['themes.php'];

        // Find and extract the Themes Dashboard item
        foreach ($themes_submenu as $key => $item) {
            if ($item[2] === 'themes-dashboard') {
                $dashboard_item = $item;
                unset($themes_submenu[$key]);
                break;
            }
        }

        // Re-index and add Themes Dashboard at the top
        if (isset($dashboard_item)) {
            $themes_submenu = array_values($themes_submenu); // reindex
            array_unshift($themes_submenu, $dashboard_item);
            $submenu['themes.php'] = $themes_submenu;
        }
    }
}

// Hook into current_screen to detect if we're on our custom page
add_action('current_screen', 'luzuk_lite_hide_admin_notices_on_custom_page');

function luzuk_lite_hide_admin_notices_on_custom_page($screen) {
    // Check for our custom page slug
    if ($screen->id === 'appearance_page_themes-dashboard') {
        // Remove all actions that show admin notices
        remove_all_actions('admin_notices');
        remove_all_actions('all_admin_notices');
        remove_all_actions('network_admin_notices');
    }
}

add_action('admin_menu', 'luzuk_lite_add_themes_dashboard_menu');

function luzuk_lite_add_themes_dashboard_menu() {
    add_theme_page(
        'Themes Dashboard',
        'Themes Dashboard',
        'manage_options',
        'themes-dashboard',
        'luzuk_lite_themes_dashboard_page'
    );
}

function luzuk_lite_themes_dashboard_page() {
    // Handle force ping request
    if ( isset( $_GET['force_tracker_ping'] ) && check_admin_referer( 'force_tracker_ping' ) ) {
        if ( function_exists( 'luzuk_lite_force_tracker_ping' ) ) {
            $result = luzuk_lite_force_tracker_ping();
            if ( $result['success'] ) {
                echo '<div class="notice notice-success is-dismissible"><p>' . esc_html( $result['message'] ) . '</p></div>';
            } else {
                echo '<div class="notice notice-error is-dismissible"><p>' . esc_html( $result['message'] ) . '</p></div>';
            }
        }
    }

    echo luzuk_lite_render_combined_dashboard();
}

function luzuk_lite_render_combined_dashboard() {
    $theme = wp_get_theme();
    $theme_name = $theme->get('Name');
    $screenshot = $theme->get_screenshot();
	$theme_description = $theme->get('Description');
    $theme_version = $theme->get('Version');

    $customize_url = admin_url('customize.php');

	// Dashboard file
	$dashboard_url = 'https://raw.githubusercontent.com/LuzukThemes/themes-dashboard/main/dashboard.html';
	$dashboard_response = wp_remote_get($dashboard_url);
	$dashboard_html = '';

	if (!is_wp_error($dashboard_response)) {
		$dashboard_html = wp_remote_retrieve_body($dashboard_response);
	} else {
		$dashboard_html = '<div class="notice notice-error"><p>Unable to load Dashboard content from GitHub.</p></div>';
	}

    ob_start(); ?>
    <div class="wrap">
        <h1>Themes Dashboard</h1>
        <div style="display: flex; gap: 30px; margin-top: 30px;">

            <!-- Left Column -->
            <div style="flex: 1; background: #fff; padding: 20px; border: 1px solid #ddd; border-radius: 8px;">
				<h2 style="margin: 0 0 30px;background: #000;color: #fff;padding: 22px;text-align: center;border-radius: 6px;">Use this coupon code and get 15% discount instantly <span style="background: #ff0000; color: #fff; padding: 5px 10px; border-radius: 5px;margin-left: 10px;">LUZUKDISCOUNT</span></h2>
                <img src="<?php echo esc_url($screenshot); ?>" alt="Theme Screenshot" style="max-width: 50%; border: 1px solid #ccc; float: left; margin-right: 20px; border-radius: 8px; border-right-color: #ff0000; border-bottom-color: #ff0000;" />
				<div style="background: #fff; padding: 20px; border: 1px solid #ddd; border-radius: 8px;">
					<h2 style="margin: 20px 0 30px;"><?php echo esc_html($theme_name); ?></h2>
					<p><strong>Version:</strong> <?php echo esc_html($theme_version); ?></p>
					<p><?php echo esc_html($theme_description); ?></p>
				</div>
                <div style="margin: 15px 0 50px;">
                    <a href="https://www.luzukdemo.com/demo/jobstride-resume/" target="_blank" class="button" style="background: #000; color: #fff; margin-right: 10px; padding: 6px 24px; font-size: 16px; font-weight: bold">Live Demo</a>
					<a href="https://www.luzukdemo.com/docs/jobstride-resume/" target="_blank" class="button" style="background: #000; color: #fff; margin-right: 10px; padding: 6px 24px; font-size: 16px; font-weight: bold">Pro Documentation</a>
					<a href="https://www.luzuk.com/products/premium-resume-wordpress-template/" target="_blank" class="button" style="background: #0056ff; color: #fff; margin-right: 10px; padding: 6px 24px; font-size: 16px; font-weight: bold">Buy Premium</a>
                </div>

                <?php echo $dashboard_html; ?>

		</div>
          
		<div style="display: flex; gap: 30px; margin-top: 30px; text-align: center;">
			<div style="flex: 2; margin: 20px 0; padding: 20px; background: #f7f7f7; border: 1px dashed #aaa;">
                <div class="coupon-ticket">
                    <div class="coupon-title">Get 15% OFF</div>
                    <div>Use Code Below:</div>
                    <div class="coupon-code" onclick="copyCoupon(this)">LUZUKDISCOUNT</div>
                </div>
                <script>
                    function copyCoupon(el) {
                        const coupon = el.textContent;
                        navigator.clipboard.writeText(coupon).then(() => {
                        el.classList.add("copied");
                        setTimeout(() => {
                            el.classList.remove("copied");
                        }, 2000);
                        });
                    }
                </script>
                  <style>
      
                .coupon-ticket {
                width: 320px;
                margin: 40px auto;
                padding: 20px;
                border: 2px dashed #ff4d4d;
                border-radius: 10px;
                background-color: #fff4f4;
                font-family: Arial, sans-serif;
                text-align: center;
                position: relative;
                }

                .coupon-ticket::before,
                .coupon-ticket::after {
                content: "";
                position: absolute;
                top: 50%;
                width: 20px;
                height: 20px;
                background-color: #fff4f4;
                border: 2px dashed #ff4d4d;
                border-radius: 50%;
                transform: translateY(-50%);
                }

                .coupon-ticket::before {
                left: -12px;
                }

                .coupon-ticket::after {
                right: -12px;
                }

                .coupon-title {
                font-size: 20px;
                color: #d80000;
                font-weight: bold;
                margin-bottom: 10px;
                }

                .coupon-code {
                display: inline-block;
                background-color: #d80000;
                color: #fff;
                padding: 8px 16px;
                font-size: 16px;
                border-radius: 4px;
                margin-top: 5px;
                letter-spacing: 1px;
                cursor: pointer;
                }
                .coupon-code::after {
                content: "Click to copy";
                position: absolute;
                top: -30px;
                left: 50%;
                transform: translateX(-50%);
                background: #333;
                color: #fff;
                padding: 5px 8px;
                border-radius: 4px;
                font-size: 12px;
                white-space: nowrap;
                opacity: 0;
                pointer-events: none;
                transition: opacity 0.3s ease;
            }

            .coupon-code:hover::after {
                opacity: 1;
            }

            .coupon-code.copied::after {
                content: "Copied!";
                background: #4caf50;
            }
            </style>
				<a href="https://www.luzuk.com/products/premium-resume-wordpress-template?_pos=5&_sid=c6cc98aa5&_ss=r" target="_blank" class="button button-primary" style="display: block; padding: 10px; background: #77b255;font-weight: bold; margin-top: 10px;">UPGRADE NOW</a><br>
			</div>
			<div style="flex: 2; margin: 20px 0; padding: 20px;"></div>
		</div>
		
    <?php
    return ob_get_clean();
}

/**
 * Show notice on frontend pages that contain shortcodes.
 * Free theme: inform user that shortcodes require premium.
 */
function luzuk_lite_shortcode_premium_notice( $content ) {
    if ( is_admin() ) {
        return $content;
    }
 
    if ( ! is_singular( 'page' ) || ! in_the_loop() || ! is_main_query() ) {
        return $content;
    }
 
    global $post;
    if ( ! $post instanceof WP_Post ) {
        return $content;
    }
 
    // Simple detection: if the original content contains shortcode syntax
    if ( strpos( $post->post_content, '[' ) === false || strpos( $post->post_content, ']' ) === false ) {
        return $content;
    }
 
    $notice  = '<div class="luzuk-shortcode-premium-notice" style="margin:20px 0;padding:12px 15px;border:1px solid #e1a200;background:#fff8e5;color:#333;font-size:14px;border-radius:4px;">';
    $notice .= esc_html__( 'Shortcodes are available only in the premium version of this theme. To use shortcode features, please purchase the premium theme.', 'Luzuk Premium' );
    $notice .= '</div>';
 
    // Add big upgrade button under the notice text
    $notice .= '<a href="https://www.luzuk.com/products/premium-resume-wordpress-template?_pos=5&_sid=c6cc98aa5&_ss=r" target="_blank" class="button button-primary" style="    color: #fff;display:block;padding:10px;background:#77b255;font-weight:bold;margin:10px 0 0 0;text-align:center;">UPGRADE NOW</a>';
 
    return $notice . $content;
}
add_filter( 'the_content', 'luzuk_lite_shortcode_premium_notice', 5 );
?>



