<?php

if (!class_exists('Kaitex_Blog')) {
    class Kaitex_Blog
    {
        public function get_archive_meta() {
            global $post;
            if(!has_term( '', 'product_cat', $post->ID)) {
                $archive_author = kaitex()->get_theme_opt( 'archive_author', true );
                $archive_comments_count = kaitex()->get_theme_opt( 'archive_comments_count', false );
                if($archive_author || $archive_comments_count) : ?>
                    <ul class="item--meta">
                        <?php if($archive_author == '1') : ?>
                            <li class="item--author">
                                <svg xmlns="http://www.w3.org/2000/svg" width="14" height="14" viewBox="0 0 14 14" fill="none">
                                    <g clip-path="url(#<?php echo 'pxl-clip0' . get_the_ID(); ?>)">
                                        <path d="M7 7C7.69223 7 8.36892 6.79473 8.9445 6.41015C9.52007 6.02556 9.96867 5.47894 10.2336 4.83939C10.4985 4.19985 10.5678 3.49612 10.4327 2.81719C10.2977 2.13825 9.96436 1.51461 9.47487 1.02513C8.98539 0.535644 8.36175 0.202301 7.68282 0.0672531C7.00388 -0.0677952 6.30015 0.0015165 5.66061 0.266423C5.02107 0.53133 4.47444 0.979934 4.08986 1.55551C3.70527 2.13108 3.5 2.80777 3.5 3.5C3.50093 4.42798 3.86997 5.31768 4.52615 5.97385C5.18233 6.63003 6.07203 6.99908 7 7ZM7 1.16667C7.46149 1.16667 7.91262 1.30352 8.29633 1.55991C8.68005 1.8163 8.97912 2.18071 9.15572 2.60707C9.33232 3.03343 9.37853 3.50259 9.2885 3.95521C9.19847 4.40784 8.97624 4.8236 8.64992 5.14992C8.32359 5.47624 7.90783 5.69847 7.45521 5.7885C7.00259 5.87853 6.53343 5.83233 6.10707 5.65572C5.68071 5.47912 5.31629 5.18005 5.0599 4.79633C4.80351 4.41262 4.66667 3.96149 4.66667 3.5C4.66667 2.88116 4.9125 2.28767 5.35008 1.85009C5.78767 1.4125 6.38116 1.16667 7 1.16667Z" fill="#666666"/>
                                        <path d="M7 8.16663C5.60809 8.16817 4.27363 8.72179 3.28939 9.70602C2.30516 10.6903 1.75154 12.0247 1.75 13.4166C1.75 13.5713 1.81146 13.7197 1.92085 13.8291C2.03025 13.9385 2.17862 14 2.33333 14C2.48804 14 2.63642 13.9385 2.74581 13.8291C2.85521 13.7197 2.91667 13.5713 2.91667 13.4166C2.91667 12.3337 3.34687 11.295 4.11265 10.5293C4.87842 9.7635 5.91703 9.33329 7 9.33329C8.08297 9.33329 9.12158 9.7635 9.88735 10.5293C10.6531 11.295 11.0833 12.3337 11.0833 13.4166C11.0833 13.5713 11.1448 13.7197 11.2542 13.8291C11.3636 13.9385 11.512 14 11.6667 14C11.8214 14 11.9697 13.9385 12.0791 13.8291C12.1885 13.7197 12.25 13.5713 12.25 13.4166C12.2485 12.0247 11.6948 10.6903 10.7106 9.70602C9.72637 8.72179 8.39191 8.16817 7 8.16663Z" fill="#666666"/>
                                    </g>
                                    <defs>
                                        <clipPath id="<?php echo 'pxl-clip0' . get_the_ID(); ?>">
                                            <rect width="14" height="14" fill="white"/>
                                        </clipPath>
                                    </defs>
                                </svg>
                                <div class="author--inner">
                                    <span>
                                        <?php $archive_author_prefix = kaitex()->get_opt('archive_author_prefix', 'by');
                                        echo wp_kses_post($archive_author_prefix); ?>
                                    </span>
                                    <a href="<?php echo get_author_posts_url( get_post_field( 'post_author', get_the_ID() ) ); ?>" title="Posts by <?php echo get_the_author_meta( 'display_name', get_post_field( 'post_author', get_the_ID() ) ); ?>" rel="author">
                                        <?php echo get_the_author_meta( 'display_name', get_post_field( 'post_author', get_the_ID() ) ); ?>
                                    </a>
                                </div>
                            </li>
                        <?php endif; ?>
                        <?php if ($archive_comments_count == '1') :
                            $comments_count = get_comments_number(get_the_ID());
                            $comment_text = sprintf('%d', $comments_count) . ' ' . (1 === intval($comments_count) ? esc_html__('Comment', 'kaitex') : esc_html__('Comments', 'kaitex'));
                            ?>
                            <li class="item--comments">
                                <svg xmlns="http://www.w3.org/2000/svg" width="14" height="14" viewBox="0 0 14 14" fill="none">
                                    <g clip-path="url(#<?php echo 'pxl-clip1' . get_the_ID(); ?>)">
                                        <path d="M7.87558 6.125C7.87558 6.608 7.48358 7 7.00058 7C6.51758 7 6.12558 6.608 6.12558 6.125C6.12558 5.642 6.51758 5.25 7.00058 5.25C7.48358 5.25 7.87558 5.642 7.87558 6.125ZM9.91725 5.25C9.43425 5.25 9.04225 5.642 9.04225 6.125C9.04225 6.608 9.43425 7 9.91725 7C10.4003 7 10.7923 6.608 10.7923 6.125C10.7923 5.642 10.4003 5.25 9.91725 5.25ZM4.08392 5.25C3.60092 5.25 3.20892 5.642 3.20892 6.125C3.20892 6.608 3.60092 7 4.08392 7C4.56692 7 4.95892 6.608 4.95892 6.125C4.95892 5.642 4.56692 5.25 4.08392 5.25ZM14.0006 2.33333V9.33333C14.0006 10.6202 12.9541 11.6667 11.6673 11.6667H10.0036L7.75892 13.5217C7.54833 13.7095 7.27825 13.804 7.00525 13.804C6.72758 13.804 6.44817 13.706 6.22533 13.5082L4.03842 11.6667H2.33333C1.0465 11.6667 0 10.6202 0 9.33333V2.33333C0.000583333 1.0465 1.04708 0 2.33392 0H11.6673C12.9541 0 14.0006 1.0465 14.0006 2.33333ZM12.8339 2.33333C12.8339 1.68992 12.3107 1.16667 11.6673 1.16667H2.33392C1.6905 1.16667 1.16725 1.68992 1.16725 2.33333V9.33333C1.16725 9.97675 1.6905 10.5 2.33392 10.5H4.25192C4.389 10.5 4.52258 10.5484 4.62817 10.6371L6.9895 12.6263L9.42258 10.6336C9.527 10.5472 9.65825 10.5 9.79417 10.5H11.6678C12.3113 10.5 12.8345 9.97675 12.8345 9.33333L12.8339 2.33333Z" fill="#666666"/>
                                    </g>
                                    <defs>
                                        <clipPath id="<?php echo 'pxl-clip1' . get_the_ID(); ?>">
                                            <rect width="14" height="14" fill="white"/>
                                        </clipPath>
                                    </defs>
                                </svg>
                                <?php echo wp_kses_post($comment_text); ?>
                            </li>
                        <?php endif; ?>
                    </ul>
                <?php endif;
            }
        }
        public function get_excerpt(){
            $archive_excerpt_length = kaitex()->get_theme_opt('archive_excerpt_length', '50');
            $kaitex_the_excerpt = get_the_excerpt();
            if(!empty($kaitex_the_excerpt)) {
                echo wp_trim_words( $kaitex_the_excerpt, $archive_excerpt_length, $more = null );
            } else {
                echo wp_kses_post($this->get_excerpt_more( $archive_excerpt_length ));
            }
        }
        public function get_excerpt_more( $post = null ) {
            $archive_excerpt_length = kaitex()->get_theme_opt('archive_excerpt_length', '50');
            $post = get_post( $post );

            if ( empty( $post ) || 0 >= $archive_excerpt_length ) {
                return '';
            }

            if ( post_password_required( $post ) ) {
                return esc_html__( 'Post password required.', 'kaitex' );
            }

            $content = apply_filters( 'the_content', strip_shortcodes( $post->post_content ) );
            $content = str_replace( ']]>', ']]&gt;', $content );

            $excerpt_more = apply_filters( 'kaitex_excerpt_more', '&hellip;' );
            $excerpt      = wp_trim_words( $content, $archive_excerpt_length, $excerpt_more );

            return $excerpt;
        }
        public function get_post_header() {
            $post_format = get_post_format();
            $post_title = kaitex()->get_opt( 'post_title', 'true' );
            ?>
            <?php if($post_title == 'true') { ?>
                <div class="pxl-post--header">
                    <h1 class="pxl-post--title"><?php the_title(); ?></h1>
                </div>
            <?php } ?>
            <?php if ($post_format == false && has_post_thumbnail()) {
                echo '<div class="pxl-post--image">'; ?>
                <?php the_post_thumbnail('kaitex-thumb-large'); ?>
                <?php echo '</div>';
            } elseif ($post_format == 'video' ) {
                $video_url = get_post_meta(get_the_ID(), 'video_url', true);
                $video_thumbnail = get_post_meta(get_the_ID(), 'video_thumbnail', true);
                if (!empty($video_url) || !empty($video_thumbnail)) : ?>
                <div class="pxl-post--video">
                    <?php $image_id = attachment_url_to_postid($video_thumbnail);
                        if (!$image_id) {
                            $attachment_id = pxl_upload_external_image($video_thumbnail);
                            if ($attachment_id) {
                                update_post_meta($post->ID, 'video_thumbnail', wp_get_attachment_url($attachment_id));
                                $video_thumbnail = get_post_meta($post->ID, 'video_thumbnail', true);
                                $image_id = attachment_url_to_postid($video_thumbnail);
                                $img = pxl_get_image_by_size( array(
                                    'attach_id'  => $image_id,
                                    'thumb_size' => '856x600',
                                    'class' => 'no-lazyload'
                                ) );
                                $thumbnail = $img['thumbnail'];
                                echo '<div class="pxl-video--image">';
                                echo wp_kses_post($thumbnail);
                                echo '</div>';
                            }
                        } elseif ($image_id) {
                        $img = pxl_get_image_by_size( array(
                            'attach_id'  => $image_id,
                            'thumb_size' => '856x600',
                            'class' => 'no-lazyload'
                        ) );
                        $thumbnail = $img['thumbnail'];
                        echo '<div class="pxl-video--image">';
                        echo wp_kses_post($thumbnail);
                        echo '</div>'; }
                    ?>
                    <?php if(!empty($video_url)) : ?>
                        <a class="btn-video" href="<?php echo esc_url($video_url); ?>">
                            <i class="bi bi-play-fill"></i>
                        </a>
                    <?php endif; ?>
                </div>
                <?php endif; ?>
            <?php }
        }

        public function get_tagged_in( $before = '', $sep = ', ', $after = '' ) {
            $tags_list = get_the_term_list( get_the_ID(), 'post_tag', $before, $sep, $after );
            $post_tag_text = kaitex()->get_opt( 'post_tag_text' );

            if ( $tags_list ) {
                echo '<div class="pxl--tags">';
                echo '<label class="label">';
                echo wp_kses_post($post_tag_text);
                echo '</label>';
                echo wp_kses_post($tags_list);
                echo '</div>';
            }
        }

        public function get_socials_share() {
            $img_url = '';
            if (has_post_thumbnail(get_the_ID()) && wp_get_attachment_image_src(get_post_thumbnail_id(get_the_ID()), false)) {
                $img_url = wp_get_attachment_image_src(get_post_thumbnail_id(get_the_ID()), false);
            }
            $social_facebook = kaitex()->get_opt( 'social_facebook', 'false' );
            $social_twitter = kaitex()->get_opt( 'social_twitter', 'false' );
            $social_pinterest = kaitex()->get_opt( 'social_pinterest', 'false' );
            $social_linkedin = kaitex()->get_opt( 'social_linkedin', 'false' );
            ?>
            <div class="pxl--social">
                <?php if($social_facebook == 'true') : ?>
                    <a class="fb-social" title="<?php echo esc_attr__('Facebook', 'kaitex'); ?>" target="_blank" href="http://www.facebook.com/sharer/sharer.php?u=<?php the_permalink(); ?>">
                        <i class="ionicons ion-social-facebook"></i>
                    </a>
                <?php endif; ?>
                <?php if($social_twitter == 'true') : ?>
                    <a class="tw-social" title="<?php echo esc_attr__('Twitter', 'kaitex'); ?>" target="_blank" href="https://twitter.com/intent/tweet?url=<?php the_permalink(); ?>">
                        <i class="ionicons ion-social-twitter"></i>
                    </a>
                <?php endif; ?>
                <?php if($social_pinterest == 'true') : ?>
                    <a class="pin-social" title="<?php echo esc_attr__('Pinterest', 'kaitex'); ?>" target="_blank" href="http://pinterest.com/pin/create/button/?url=<?php the_permalink(); ?>&media=<?php echo esc_url($img_url[0]); ?>">
                        <i class="ionicons ion-social-pinterest"></i>
                    </a>
                <?php endif; ?>
                <?php if($social_linkedin == 'true') : ?>
                    <a class="lin-social" title="<?php echo esc_attr__('LinkedIn', 'kaitex'); ?>" target="_blank" href="http://www.linkedin.com/shareArticle?mini=true&url=<?php the_permalink(); ?>">
                        <i class="ion-social-linkedin"></i>
                    </a>
                <?php endif; ?>
            </div>
            <?php
        }
        public function get_post_nav() {
            global $post;
            $previous = ( is_attachment() ) ? get_post( $post->post_parent ) : get_adjacent_post( false, '', true );
            $next     = get_adjacent_post( false, '', false );

            if ( ! $next && ! $previous )
                return;
            ?>
            <?php
            $next_post = get_next_post();
            $previous_post = get_previous_post();

            if( !empty($next_post) || !empty($previous_post) ) {
                ?>
                <div class="pxl-post--navigation">
                    <div class="previous-post">
                        <?php if ( is_a( $previous_post , 'WP_Post' ) && get_the_title( $previous_post->ID ) != '') { ?>
                            <a class="prev--item" href="<?php echo esc_url(get_permalink( $previous_post->ID )); ?>">
                                <div class="item--arrow">
                                    <svg xmlns="http://www.w3.org/2000/svg" width="28" height="26" viewBox="0 0 28 26" fill="none">
                                        <path d="M23.6135 20.4776L5.22843 5.05065M5.22843 5.05065L6.18181 14.4663M5.22843 5.05065L14.6666 4.35453" stroke-width="2"/>
                                    </svg>
                                    <svg xmlns="http://www.w3.org/2000/svg" width="28" height="26" viewBox="0 0 28 26" fill="none">
                                        <path d="M23.6135 20.4776L5.22843 5.05065M5.22843 5.05065L6.18181 14.4663M5.22843 5.05065L14.6666 4.35453" stroke-width="2"/>
                                    </svg>
                                </div>
                                <span class="nav--label label--prev"><?php echo esc_html__('Previous', 'kaitex'); ?></span>
                            </a>
                        <?php } ?>
                    </div>
                    <div class="next-post">
                        <?php if ( is_a( $next_post , 'WP_Post' ) && get_the_title( $next_post->ID ) != '') { ?>
                            <a class="next--item" href="<?php echo esc_url(get_permalink( $next_post->ID )); ?>">
                                <span class="nav--label label--next"><?php echo esc_html__('Next', 'kaitex'); ?></span>
                                <div class="item--arrow">
                                    <svg xmlns="http://www.w3.org/2000/svg" width="27" height="26" viewBox="0 0 27 26" fill="none">
                                        <path d="M4.23807 20.4824L22.6231 5.05553M22.6231 5.05553L21.6698 14.4712M22.6231 5.05553L13.185 4.35942" stroke-width="2"/>
                                    </svg>
                                    <svg xmlns="http://www.w3.org/2000/svg" width="27" height="26" viewBox="0 0 27 26" fill="none">
                                        <path d="M4.23807 20.4824L22.6231 5.05553M22.6231 5.05553L21.6698 14.4712M22.6231 5.05553L13.185 4.35942" stroke-width="2"/>
                                    </svg>
                                </div>
                            </a>
                        <?php } ?>
                    </div>
                </div>
            <?php }
        }
        public function get_post_service_nav() {
            global $post;
            $previous = ( is_attachment() ) ? get_post( $post->post_parent ) : get_adjacent_post( false, '', true );
            $next     = get_adjacent_post( false, '', false );
            $service_nav_link = kaitex()->get_theme_opt( 'service_nav_link' );
            $service_nav_text = kaitex()->get_theme_opt( 'service_nav_text' );
            if ( ! $next && ! $previous )
                return;
            ?>
            <?php
            $next_post = get_next_post();
            $previous_post = get_previous_post();

            if( !empty($next_post) || !empty($previous_post) ) {
                ?>
                <div class="pxl-post--navigation">
                    <div class="pxl--item pxl--item-prev">
                        <?php if ( is_a( $previous_post , 'WP_Post' ) && get_the_title( $previous_post->ID ) != '') {
                            $prev_img_id = get_post_thumbnail_id($previous_post->ID);
                            $prev_img_url = wp_get_attachment_image_src($prev_img_id, 'kaitex-thumb-small');
                            ?>
                            <?php if(!empty($prev_img_id)) : ?>
                                <div class="pxl--img">
                                    <a  href="<?php echo esc_url(get_permalink( $previous_post->ID )); ?>"><img src="<?php echo wp_kses_post($prev_img_url[0]); ?>" alt="<?php echo get_the_title( $previous_post->ID ); ?>" /></a>
                                </div>
                            <?php endif; ?>
                            <div class="pxl--holder">
                                <div class="pxl--meta">
                                    <a  href="<?php echo esc_url(get_permalink( $previous_post->ID )); ?>"><?php echo get_the_title( $previous_post->ID ); ?></a>
                                </div>
                                <a class="pxl--label" href="<?php echo esc_url(get_permalink( $previous_post->ID )); ?>"><?php echo esc_html__('Read More', 'kaitex'); ?><i class="far fa-long-arrow-right"></i></a>
                            </div>
                        <?php } ?>
                    </div>
                    <a class="pxl-show--all" href="<?php echo esc_url($service_nav_link); ?>" data-tip="<?php if(!empty($service_nav_text)) { echo pxl_print_html($service_nav_text); } else { echo pxl_print_html('Show All Services', 'kaitex');} ?>">
                        <svg class="svg-hover" width="31" height="31" viewBox="0 0 31 31">
                            <path class="cls-2" d="M3.1,0A3.1,3.1,0,1,1,0,3.1,3.1,3.1,0,0,1,3.1,0ZM15.5,0a3.1,3.1,0,1,1-3.1,3.1A3.1,3.1,0,0,1,15.5,0ZM27.9,0a3.1,3.1,0,1,1-3.1,3.1A3.1,3.1,0,0,1,27.9,0ZM3.1,12.4A3.1,3.1,0,1,1,0,15.5,3.1,3.1,0,0,1,3.1,12.4Zm12.4,0a3.1,3.1,0,1,1-3.1,3.1A3.1,3.1,0,0,1,15.5,12.4Zm12.4,0a3.1,3.1,0,1,1-3.1,3.1A3.1,3.1,0,0,1,27.9,12.4ZM3.1,24.8A3.1,3.1,0,1,1,0,27.9,3.1,3.1,0,0,1,3.1,24.8Zm12.4,0a3.1,3.1,0,1,1-3.1,3.1A3.1,3.1,0,0,1,15.5,24.8Zm12.4,0a3.1,3.1,0,1,1-3.1,3.1A3.1,3.1,0,0,1,27.9,24.8Z"/>
                        </svg>
                        <svg class="svg-main" width="25" height="25" viewBox="0 0 25 25">
                            <path class="cls-1" d="M2.5,0A2.5,2.5,0,1,1,0,2.5,2.5,2.5,0,0,1,2.5,0Zm10,0A2.5,2.5,0,1,1,10,2.5,2.5,2.5,0,0,1,12.5,0Zm10,0A2.5,2.5,0,1,1,20,2.5,2.5,2.5,0,0,1,22.5,0ZM2.5,10A2.5,2.5,0,1,1,0,12.5,2.5,2.5,0,0,1,2.5,10Zm10,0A2.5,2.5,0,1,1,10,12.5,2.5,2.5,0,0,1,12.5,10Zm10,0A2.5,2.5,0,1,1,20,12.5,2.5,2.5,0,0,1,22.5,10ZM2.5,20A2.5,2.5,0,1,1,0,22.5,2.5,2.5,0,0,1,2.5,20Zm10,0A2.5,2.5,0,1,1,10,22.5,2.5,2.5,0,0,1,12.5,20Zm10,0A2.5,2.5,0,1,1,20,22.5,2.5,2.5,0,0,1,22.5,20Z"/>
                        </svg>
                    </a>
                    <div class="pxl--item pxl--item-next">
                        <?php if ( is_a( $next_post , 'WP_Post' ) && get_the_title( $next_post->ID ) != '') {
                            $next_img_id = get_post_thumbnail_id($next_post->ID);
                            $next_img_url = wp_get_attachment_image_src($next_img_id, 'kaitex-thumb-small');
                            ?>
                            <div class="pxl--holder">
                                <div class="pxl--meta">
                                    <a href="<?php echo esc_url(get_permalink( $next_post->ID )); ?>"><?php echo get_the_title( $next_post->ID ); ?></a>
                                </div>
                                <a class="pxl--label" href="<?php echo esc_url(get_permalink( $next_post->ID )); ?>"><?php echo esc_html__('Read More', 'kaitex'); ?><i class="far fa-long-arrow-right"></i></a>
                            </div>
                            <?php if(!empty($next_img_id)) : ?>
                                <div class="pxl--img">
                                    <a href="<?php echo esc_url(get_permalink( $next_post->ID )); ?>"><img src="<?php echo wp_kses_post($next_img_url[0]); ?>" alt="<?php echo get_the_title( $next_post->ID ); ?>" /></a>
                                </div>
                            <?php endif; ?>
                        <?php } ?>
                    </div>
                </div>
            <?php }
        }
        public function get_post_portfolio_nav() {
            global $post;
            $previous = ( is_attachment() ) ? get_post( $post->post_parent ) : get_adjacent_post( false, '', true );
            $next     = get_adjacent_post( false, '', false );
            $portfolio_nav_link = kaitex()->get_theme_opt( 'portfolio_nav_link' );
            $portfolio_nav_text = kaitex()->get_theme_opt( 'portfolio_nav_text' );
            if ( ! $next && ! $previous )
                return;
            ?>
            <?php
            $next_post = get_next_post();
            $previous_post = get_previous_post();

            if( !empty($next_post) || !empty($previous_post) ) {
                ?>
                <div class="pxl-post--navigation">
                    <div class="pxl--item pxl--item-prev">
                        <?php if ( is_a( $previous_post , 'WP_Post' ) && get_the_title( $previous_post->ID ) != '') { ?>
                            <div class="pxl--holder">
                                <a class="pxl--link" href="<?php echo esc_url(get_permalink( $previous_post->ID )); ?>" data-tip="<?php echo get_the_title( $previous_post->ID ); ?>">
                                    <span class="line"></span> <span class="circle"></span><span class="dot"></span>
                                </a>
                            </div>
                        <?php } ?>
                    </div>
                    <a class="pxl-show--all" href="<?php echo esc_url($portfolio_nav_link); ?>" data-tip="<?php if(!empty($portfolio_nav_text)) { echo pxl_print_html($portfolio_nav_text); } else { echo pxl_print_html('Show All Projects', 'kaitex');} ?>">
                        <svg class="svg-hover" width="25" height="25" viewBox="0 0 25 25" fill="none" xmlns="http://www.w3.org/2000/svg">
                            <rect x="0.5" y="0.5" width="10" height="10"/>
                            <rect x="14.5" y="0.5" width="10" height="10"/>
                            <rect x="0.5" y="14.5" width="10" height="10"/>
                            <rect x="14.5" y="14.5" width="10" height="10"/>
                        </svg>
                        <svg class="svg-main" width="25" height="25" viewBox="0 0 25 25" fill="none" xmlns="http://www.w3.org/2000/svg">
                            <rect x="0.5" y="0.5" width="10" height="10"/>
                            <rect x="14.5" y="0.5" width="10" height="10"/>
                            <rect x="0.5" y="14.5" width="10" height="10"/>
                            <rect x="14.5" y="14.5" width="10" height="10"/>
                        </svg>
                    </a>
                    <div class="pxl--item pxl--item-next">
                        <?php if ( is_a( $next_post , 'WP_Post' ) && get_the_title( $next_post->ID ) != '') { ?>
                            <div class="pxl--holder">
                                <a class="pxl--link" href="<?php echo esc_url(get_permalink( $next_post->ID )); ?>" data-tip="<?php echo get_the_title( $next_post->ID ); ?>">
                                    <span class="line"></span> <span class="circle"></span><span class="dot"></span>
                                </a>
                            </div>
                        <?php } ?>
                    </div>
                </div>
            <?php }
        }
    }
}
