<?php
function testi_loop()
{
$arg = array(
'post_type' => 'testimonial',
'posts_per_page' => -1,
);
$testiPost = new WP_Query($arg);
if ($testiPost->have_posts()): ?>
<div class="testiWrapper">
<div class="swiper testimonialsChild">
<div class="swiper-wrapper">
<?php while ($testiPost->have_posts()):
$testiPost->the_post();
$url = wp_get_attachment_url(get_post_thumbnail_id($testiPost->ID)); ?>
<div class="swiper-slide singleTesti">
<div class="row">
<div class="col-md-8">
<div class="testiReview-areaWrapper">
<div class="testiReview-area">
<h4>
<?php the_title(); ?>
</h4>
<?php the_content(); ?>
<div class="testi-chat-img">
<img src="<?php the_field('testimonial_chatimg'); ?>" alt="profile">
</div>
</div>
</div>
</div>
<div class="col-md-4">
<div class="profileArea">
<div class="profileImgWrapper">
<img src="<?php echo $url; ?>" alt="profile">
</div>
<div class="authortesti">
<h6>
<?php the_field('client_name'); ?>
</h6>
</div>
</div>
</div>
</div>
</div>
<?php endwhile; ?>
</div>
<div class="swiper-pagination"></div>
</div>
</div>
<?php endif;
wp_reset_postdata();
}
add_shortcode('testi', 'testi_loop');
?>
<?php
function team_loop()
{
$arg = array(
'post_type' => 'team',
'posts_per_page' => -1,
);
$teamPost = new WP_Query($arg);
if ($teamPost->have_posts()): ?>
<div class="swiper teamswiper">
<div class="swiper-wrapper">
<?php while ($teamPost->have_posts()):
$teamPost->the_post();
$url = wp_get_attachment_url(get_post_thumbnail_id($teamPost->ID)); ?>
<div class="swiper-slide">
<img src="<?php echo $url; ?>" alt="">
<div class="team-content">
<div class="team-social-wrapp">
<div class="team-social">
<div class="share"><i class="fa-solid fa-share-nodes"></i></div>
<div class="team-social-icons">
<a><i class="fa-brands fa-facebook-f"></i></a>
<a><i class="fa-brands fa-twitter"></i></a>
<a><i class="fa-brands fa-linkedin-in"></i></a>
<a><i class="fa-brands fa-square-instagram"></i></a>
</div>
</div>
</div>
<h3>
<?php the_title(); ?>
</h3>
<?php the_content(); ?>
</div>
</div>
<?php endwhile; ?>
</div>
</div>
<?php endif;
wp_reset_postdata();
}
add_shortcode('team', 'team_loop');
?>
<?php
function blog_loop()
{
$arg = array(
'post_type' => 'post',
'posts_per_page' => 3,
);
$blogPost = new WP_Query($arg);
?>
<div class="blog-card-sec">
<div class="row">
<?php if ($blogPost->have_posts()): ?>
<?php while ($blogPost->have_posts()): ?>
<?php $blogPost->the_post();
$url = wp_get_attachment_url(get_post_thumbnail_id($blogPost->ID)); ?>
<div class="col-md-4">
<div class="blogcard">
<img src="<?php echo $url ?>" alt="" width="100%" class="blogcard-img">
<div class="blog-card-wrapper">
<div class="blog-inner">
<div class="blog-status">
<div class="blog-status-img">
<img src="<?php echo get_template_directory_uri(); ?>/images/Content/calendar.png"
alt="">
</div>
<h6>
<?php the_time('j F, Y'); ?>
</h6>
</div>
<div class="blog-status">
<div class="blog-status-img">
<img src="<?php echo get_template_directory_uri(); ?>/images/Content/user.png" alt="">
</div>
<h6>
<?php the_author(); ?>
</h6>
</div>
</div>
<div class="blog-card-content">
<?php $title = get_the_title();
?>
<h3><a href="<?php the_permalink(); ?>">
<?php echo substr($title, 0, 34); ?>
</a></h3>
<?php $content = get_the_content();
?>
<div class="post-content">
<p>
<?php echo substr($content, 0, 108); ?>
</p>
</div>
<a href="<?php the_permalink(); ?>">Read More</a>
</div>
</div>
</div>
</div>
<?php endwhile; ?>
<?php endif; ?>
</div>
</div>
<?php
wp_reset_postdata();
}
add_shortcode('blogAll', 'blog_loop');
?>
<?php
function posta_loop()
{
$paged = (get_query_var('paged')) ? get_query_var('paged') : 1;
$arg = array(
'post_type' => 'post',
'posts_per_page' => 4,
'paged' => $paged
);
$blogPost = new WP_Query($arg);
?>
<div id="mainBlog" class="blog-left">
<?php if ($blogPost->have_posts()): ?>
<?php while ($blogPost->have_posts()): ?>
<?php $blogPost->the_post();
$content = get_the_content();
?>
<div class="single-blog-box">
<img src="<?php the_post_thumbnail_url('full'); ?>" alt="" width="100%" class="single-img">
<div class="single-blog-cont">
<div class="blog-authors">
<div class="blog-authors-inner">
<div class="blog-authors-icons">
<img src="<?php echo get_template_directory_uri(); ?>/images/blog/user.png" alt="">
</div>
<h6>
<?php the_author(); ?>
</h6>
</div>
<div class="blog-authors-inner">
<div class="blog-authors-icons">
<img src="<?php echo get_template_directory_uri(); ?>/images/blog/chat.png" alt="">
</div>
<h6>
<?php the_time('j F, Y'); ?>
</h6>
</div>
<div class="blog-authors-inner">
<div class="blog-authors-icons">
<img src="<?php echo get_template_directory_uri(); ?>/images/blog/calendar.png" alt="">
</div>
<h6>No Comments</h6>
</div>
</div>
<h3>
<?php the_title(); ?>
</h3>
<?php $content = get_the_content();
?>
<p>
<?php echo substr($content, 0, 308); ?>
</p>
<a href="<?php the_permalink(); ?>">Read More</a>
</div>
</div>
<?php endwhile; ?>
<?php
$big = 99;
echo '<div class="pagination">';
echo paginate_links(
array(
'base' => str_replace($big, '%#%', esc_url(get_pagenum_link($big))),
'format' => '?paged=%#%',
'current' => max(1, get_query_var('paged')),
'total' => $blogPost->max_num_pages,
'show_all' => false,
'prev_next' => false,
'before_page_number' => '0',
'prev_text' => __('Previous'),
'next_text' => __('Next'),
'type' => 'list',
'mid_size' => 2
)
);
$next_link = get_next_posts_link('Next Page', $blogPost->max_num_pages);
if ($next_link) {
echo '<button>' . $next_link . '</button>';
}
echo '</div>';
?>
<?php endif; ?>
</div>
<?php
wp_reset_postdata();
}
add_shortcode('allBlogsss', 'posta_loop');
?>
<?php
function dynamic_categories_shortcode()
{
ob_start();
$categories = get_categories(
array(
'taxonomy' => 'category',
'object_type' => array('post', 'blogPost'),
)
);
if ($categories) {
echo '<div class="categories">';
echo '<h4>Categories</h4>';
echo '<ul>';
foreach ($categories as $category) {
echo '<li><a href="' . esc_url(get_category_link($category->term_id)) . '">' . esc_html($category->name) . '</a></li>';
}
echo '</ul>';
echo '</div>';
}
$output = ob_get_clean();
return $output;
}
add_shortcode('dynamicCategories', 'dynamic_categories_shortcode');
?>
<?php
function faq_loop()
{
$args = array(
'post_type' => 'faq',
'posts_per_page' => -1,
);
$faq_posts = new WP_Query($args);
if ($faq_posts->have_posts()): ?>
<div class="row">
<div class="col-md-6">
<div class="accordion" id="accordionLeft">
<?php $count = 0; ?>
<?php while ($faq_posts->have_posts() && $count < 4):
$faq_posts->the_post(); ?>
<div class="accordion-item">
<h2 class="accordion-header" id="heading-<?php the_ID(); ?>">
<button class="accordion-button<?php echo ($count === 0) ? '' : ' collapsed'; ?>" type="button"
data-bs-toggle="collapse" data-bs-target="#collapse-<?php the_ID(); ?>"
aria-expanded="<?php echo ($count === 0) ? 'true' : 'false'; ?>"
aria-controls="collapse-<?php the_ID(); ?>">
<?php the_title(); ?>
</button>
</h2>
<div id="collapse-<?php the_ID(); ?>" class="accordion-collapse collapse<?php if ($count === 0)
echo ' show'; ?>" aria-labelledby="heading-<?php the_ID(); ?>"
data-bs-parent="#accordionRight">
<div class="accordion-body">
<?php the_content(); ?>
</div>
</div>
</div>
<?php $count++; ?>
<?php endwhile; ?>
</div>
</div>
<div class="col-md-6">
<div class="accordion" id="accordionRight">
<?php while ($faq_posts->have_posts()):
$faq_posts->the_post(); ?>
<div class="accordion-item">
<h2 class="accordion-header" id="heading-<?php the_ID(); ?>">
<button class="accordion-button collapsed" type="button" data-bs-toggle="collapse"
data-bs-target="#collapse-<?php the_ID(); ?>" aria-expanded="false"
aria-controls="collapse-<?php the_ID(); ?>">
<?php the_title(); ?>
</button>
</h2>
<div id="collapse-<?php the_ID(); ?>" class="accordion-collapse collapse"
aria-labelledby="heading-<?php the_ID(); ?>" data-bs-parent="#accordionRight">
<div class="accordion-body">
<?php the_content(); ?>
</div>
</div>
</div>
<?php endwhile; ?>
</div>
</div>
</div>
<?php endif;
wp_reset_postdata();
}
add_shortcode('faq', 'faq_loop');
?>
<?php
function generate_tab_navigation()
{
$args = array('post_type' => 'casestudie', 'posts_per_page' => -1);
$casestudiePost = new WP_Query($args);
if ($casestudiePost->have_posts()): ?>
<div class="project-tabs-wrapper">
<ul class="nav nav-pills mb-3" id="pills-tab" role="tablist">
<?php
$nav_counter = 1;
while ($casestudiePost->have_posts()):
$casestudiePost->the_post(); ?>
<li class="nav-item" role="presentation">
<button class="nav-link <?php echo ($nav_counter === 1) ? 'active' : ''; ?>"
id="pills-home-tab-<?php echo $nav_counter; ?>-tab" data-bs-toggle="pill"
data-bs-target="#pills-home-<?php echo $nav_counter; ?>" type="button" role="tab"
aria-controls="pills-home-<?php echo $nav_counter; ?>"
aria-selected="<?php echo ($nav_counter === 1) ? 'true' : 'false'; ?>">
<?php the_title(); ?>
</button>
</li>
<?php $nav_counter++;
endwhile; ?>
</ul>
</div>
<?php
endif;
wp_reset_postdata();
}
function generate_tab_content()
{
$args = array('post_type' => 'casestudie', 'posts_per_page' => -1);
$casestudiePost = new WP_Query($args);
if ($casestudiePost->have_posts()): ?>
<div class="verticl-tab-cont">
<div class="tab-content" id="v-pills-tabContent">
<?php
$content_counter = 1;
while ($casestudiePost->have_posts()):
$casestudiePost->the_post(); ?>
<div class="tab-pane fade <?php echo ($content_counter === 1) ? 'show active' : ''; ?>"
id="pills-home-<?php echo $content_counter; ?>" role="tabpanel"
aria-labelledby="pills-home-tab-<?php echo $content_counter; ?>-tab">
<div class="tabs-content-wrapper">
<div class="row">
<?php
$repeatcont = get_field('caserepeaters');
foreach ($repeatcont as $repeatcase) { ?>
<div class="col-md-6">
<div class="single-project-card">
<img src="<?php echo $repeatcase['casetabs_img'] ?>">
<div class="project-card-cont">
<div class="projectcard-tittle">
<h3>
<?php echo $repeatcase['casetabs_tittle'] ?>
</h3>
<h6>
<?php echo $repeatcase['casetabs_date'] ?>
</h6>
</div>
<?php echo $repeatcase['casetab_para'] ?>
</div>
</div>
</div>
<?php
} ?>
</div>
</div>
</div>
<?php $content_counter++;
endwhile; ?>
</div>
</div>
<?php
endif;
wp_reset_postdata();
}
function casestudies_tab_navigation_shortcode()
{
ob_start();
generate_tab_navigation();
return ob_get_clean();
}
add_shortcode('casestudies_tabs', 'casestudies_tab_navigation_shortcode');
function casestudies_tab_content_shortcode()
{
ob_start();
generate_tab_content();
return ob_get_clean();
}
add_shortcode('casestudies_content', 'casestudies_tab_content_shortcode');
?>
<?php
function ecommerceguru_shortcode()
{
ob_start();
?>
<div class="swiper GameGurruswiper">
<div class="swiper-wrapper">
<?php
$arg = array(
'post_type' => 'gamingguru',
'posts_per_page' => -1,
);
$gamingguruPost = new WP_Query($arg);
if ($gamingguruPost->have_posts()):
while ($gamingguruPost->have_posts()):
$gamingguruPost->the_post();
?>
<div class="swiper-slide">
<div class="gaminggurruTabsWrapper">
<div class="gaminggurruTabs-btn">
<div class="nav nav-tabs" id="gaminggurruTabs<?php echo get_the_ID(); ?>" role="tablist">
<button class="nav-link active" id="nav-home<?php echo get_the_ID(); ?>-tab"
data-bs-toggle="tab" data-bs-target="#nav-home<?php echo get_the_ID(); ?>" type="button"
role="tab" aria-controls="nav-home<?php echo get_the_ID(); ?>" aria-selected="true">
<img src="<?php echo get_field('first_profile_tabimg'); ?>" alt="">
</button>
<button class="nav-link" id="nav-home2<?php echo get_the_ID(); ?>-tab" data-bs-toggle="tab"
data-bs-target="#nav-home2<?php echo get_the_ID(); ?>" type="button" role="tab"
aria-controls="nav-home2<?php echo get_the_ID(); ?>" aria-selected="false">
<img src="<?php echo get_field('caseprofile_tabimg'); ?>" alt="">
</button>
</div>
</div>
<div class="tab-content" id="nav-tabContent">
<div class="tab-pane fade show active" id="nav-home<?php echo get_the_ID(); ?>" role="tabpanel"
aria-labelledby="nav-home<?php echo get_the_ID(); ?>-tab">
<div class="row">
<div class="col-md-4">
<div class="gameGurru-profileImg">
<img src="<?php echo get_field('firstprof_mainimg'); ?>" alt="">
</div>
</div>
<div class="col-md-8">
<div class="gameGurruTabs-contentWrapper">
<div class="singleGameGurru">
<h2>
<?php echo get_field('first_profiletittle'); ?>
</h2>
<h3>
<?php echo get_field('first_profilesubtittle'); ?>
</h3>
</div>
<div class="gameGurrulLabels">
<ul>
<?php
$firstprofi = get_field('firstprofileboxes');
foreach ($firstprofi as $firstprofi): ?>
<li>
<p>
<?php echo $firstprofi['firstprofileboxes_subtittle']; ?>
</p>
<h6>
<?php echo $firstprofi['firstprofileboxes_tittle']; ?>
</h6>
</li>
<?php endforeach; ?>
</ul>
</div>
<h4>
<?php echo get_field('linkedin_head'); ?>
</h4>
<?php echo get_field('linkedin_para'); ?>
<div class="gameGurrulButtonWrapper">
<a href="<?php echo get_field('firstprof_btnlink1'); ?>">
<?php echo get_field('firstprof_btntxt1'); ?>
</a>
<a href="<?php echo get_field('firstprof_btnlink2'); ?>">
<?php echo get_field('firstprof_btntxt2'); ?>
</a>
</div>
</div>
</div>
</div>
</div>
<div class="tab-pane fade" id="nav-home2<?php echo get_the_ID(); ?>" role="tabpanel"
aria-labelledby="nav-home2<?php echo get_the_ID(); ?>-tab">
<div class="row">
<div class="col-md-4">
<div class="gameGurru-profileImg">
<img src="<?php echo get_field('caseprof_mainimg'); ?>" alt="">
</div>
</div>
<div class="col-md-8">
<div class="gameGurruTabs-contentWrapper">
<div class="singleGameGurru">
<h2>
<?php echo get_field('caseprofile_tabtittle'); ?>
</h2>
<h3>
<?php echo get_field('caseprofile_tabsubtittle'); ?>
</h3>
</div>
<div class="gameGurrulLabels">
<ul>
<?php
$caseprofil = get_field('caseprofileboxes');
foreach ($caseprofil as $caseprofil): ?>
<li>
<p>
<?php echo $caseprofil['caseprofileboxes_tittle']; ?>
</p>
<h6>
<?php echo $caseprofil['caseprofileboxes_subtittle']; ?>
</h6>
</li>
<?php endforeach; ?>
</ul>
</div>
<h4>
<?php echo get_field('linkedin_head2'); ?>
</h4>
<?php echo get_field('linkedin_para2'); ?>
<div class="gameGurrulButtonWrapper">
<a href="<?php echo get_field('caseprof_btnlink1'); ?>">
<?php echo get_field('caseprof_btntxt1'); ?>
</a>
<a href="<?php echo get_field('caseprof_btnlink2'); ?>">
<?php echo get_field('caseprof_btntxt2'); ?>
</a>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<?php
endwhile;
wp_reset_postdata();
endif;
?>
</div>
</div>
<?php
return ob_get_clean();
}
add_shortcode('ecommerceguru', 'ecommerceguru_shortcode');
?>
<?php
function gamingguru_shortcode()
{
ob_start();
?>
<div class="swiper GameGurruswiper">
<div class="swiper-wrapper">
<?php
$arg = array(
'post_type' => 'gamingguru',
'posts_per_page' => -1,
);
$gamingguruPost = new WP_Query($arg);
if ($gamingguruPost->have_posts()):
while ($gamingguruPost->have_posts()):
$gamingguruPost->the_post();
?>
<div class="swiper-slide">
<div class="gaminggurruTabsWrapper">
<div class="gaminggurruTabs-btn">
<div class="nav nav-tabs" id="gaminggurruTabs<?php echo get_the_ID(); ?>" role="tablist">
<button class="nav-link active" id="nav-home<?php echo get_the_ID(); ?>-tab"
data-bs-toggle="tab" data-bs-target="#nav-home<?php echo get_the_ID(); ?>" type="button"
role="tab" aria-controls="nav-home<?php echo get_the_ID(); ?>" aria-selected="true">
<img src="<?php echo get_field('gamingnormalprofile_tabimg'); ?>" alt="">
</button>
<button class="nav-link" id="nav-home2<?php echo get_the_ID(); ?>-tab" data-bs-toggle="tab"
data-bs-target="#nav-home2<?php echo get_the_ID(); ?>" type="button" role="tab"
aria-controls="nav-home2<?php echo get_the_ID(); ?>" aria-selected="false">
<img src="<?php echo get_field('gamingpersonalprofile_tabimg'); ?>" alt="">
</button>
</div>
</div>
<div class="tab-content" id="nav-tabContent">
<div class="tab-pane fade show active" id="nav-home<?php echo get_the_ID(); ?>" role="tabpanel"
aria-labelledby="nav-home<?php echo get_the_ID(); ?>-tab">
<div class="row">
<div class="col-md-4">
<div class="gameGurru-profileImg">
<img src="<?php echo get_field('gamingnormalprofile_mainimg'); ?>" alt="">
</div>
</div>
<div class="col-md-8">
<div class="gameGurruTabs-contentWrapper">
<div class="singleGameGurru">
<h2>
<?php echo get_field('gamingnormalprofile_tabtittle'); ?>
</h2>
<h3>
<?php echo get_field('gamingnormalprofile_tabsubtittle'); ?>
</h3>
</div>
<div class="gameGurrulLabels">
<ul>
<?php
$gamingnormalprofilebox = get_field('gamingnormalprofileboxes');
foreach ($gamingnormalprofilebox as $gamingnormalprofilebox): ?>
<li>
<p>
<?php echo $gamingnormalprofilebox['gamingnormalprofileboxes_tittle']; ?>
</p>
<h6>
<?php echo $gamingnormalprofilebox['gamingnormalprofileboxes_subtittle']; ?>
</h6>
</li>
<?php endforeach; ?>
</ul>
</div>
<h4>
<?php echo get_field('gamingnormalprofile_linkedin_head'); ?>
</h4>
<?php echo get_field('gamingnormalprofile_linkedin_para'); ?>
<div class="gameGurrulButtonWrapper">
<a href="<?php echo get_field('gamingnormalprofile_first_btnlink1'); ?>">
<?php echo get_field('gamingnormalprofile_firstprof_btntxt1'); ?>
</a>
<a href="<?php echo get_field('gamingnormalprofile_first_btnlink2'); ?>">
<?php echo get_field('gamingnormalprofile_firstprof_btntxt2'); ?>
</a>
</div>
</div>
</div>
</div>
</div>
<div class="tab-pane fade" id="nav-home2<?php echo get_the_ID(); ?>" role="tabpanel"
aria-labelledby="nav-home2<?php echo get_the_ID(); ?>-tab">
<div class="row">
<div class="col-md-4">
<div class="gameGurru-profileImg">
<img src="<?php echo get_field('gamingpersonalprofileboxes_mainimg'); ?>" alt="">
</div>
</div>
<div class="col-md-8">
<div class="gameGurruTabs-contentWrapper">
<div class="singleGameGurru">
<h2>
<?php echo get_field('gamingpersonalprofile_tabtittle'); ?>
</h2>
<h3>
<?php echo get_field('gamingpersonalprofile_tabsubtittle'); ?>
</h3>
</div>
<div class="gameGurrulLabels">
<ul>
<?php
$gamingpersonalprofilebox = get_field('gamingpersonalprofileboxes');
foreach ($gamingpersonalprofilebox as $gamingpersonalprofilebox): ?>
<li>
<p>
<?php echo $gamingpersonalprofilebox['gamingpersonalprofileboxes_tittle']; ?>
</p>
<h6>
<?php echo $gamingpersonalprofilebox['gamingpersonalprofileboxes_subtittle']; ?>
</h6>
</li>
<?php endforeach; ?>
</ul>
</div>
<h4>
<?php echo get_field('gamingpersonalprofile_linkdin_head'); ?>
</h4>
<?php echo get_field('gamingpersonalprofile_linkdin_para'); ?>
<div class="gameGurrulButtonWrapper">
<a href="<?php echo get_field('gamingpersonalprofile_firstprof_btnlink1'); ?>">
<?php echo get_field('gamingpersonalprofile__firstprof_btntxt1'); ?>
</a>
<a href="<?php echo get_field('gamingpersonalprofile_firstprof_btnlink_2'); ?>">
<?php echo get_field('gamingpersonalprofile_firstprof_btntxt2'); ?>
</a>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<?php
endwhile;
wp_reset_postdata();
endif;
?>
</div>
</div>
<?php
return ob_get_clean();
}
add_shortcode('gamingguru', 'gamingguru_shortcode');
?>
<?php
function generate_gamingtab_navigation()
{
$args = array('post_type' => 'gamingtab', 'posts_per_page' => -1);
$gamingtabPost = new WP_Query($args);
if ($gamingtabPost->have_posts()): ?>
<div class="gamegallery-tabs">
<div class="nav flex-column nav-pills" id="v-pills-tab" role="tablist" aria-orientation="vertical">
<?php
$nav_counter = 1;
while ($gamingtabPost->have_posts()):
$gamingtabPost->the_post(); ?>
<button class="nav-link" id="v-pills-<?php echo $nav_counter; ?>-tab" data-bs-toggle="pill"
data-bs-target="#v-pills-<?php echo $nav_counter; ?>" type="button" role="tab"
aria-controls="v-pills-<?php echo $nav_counter; ?>" aria-selected="true">
<div class="accordion" id="accordion-<?php echo $nav_counter; ?>">
<div class="accordion-item">
<h2 class="accordion-header" id="heading-<?php echo $nav_counter; ?>">
<div class="accordion-button" type="button" data-bs-toggle="collapse"
data-bs-target="#collapse-<?php echo $nav_counter; ?>"
aria-expanded="<?php echo ($nav_counter == 1) ? 'true' : 'false'; ?>"
aria-controls="collapse-<?php echo $nav_counter; ?>">
<span>
<?php the_title(); ?>
</span>
</div>
</h2>
<div id="collapse-<?php echo $nav_counter; ?>"
class="accordion-collapse <?php echo ($nav_counter == 1) ? 'show' : 'collapse'; ?>"
aria-labelledby="heading-<?php echo $nav_counter; ?>"
data-bs-parent="#accordion-<?php echo $nav_counter; ?>">
<div class="accordion-body">
<?php
$mainimagestabs_nav = get_field('mainimagestabs');
if ($mainimagestabs_nav):
foreach ($mainimagestabs_nav as $index => $mainimagestab): ?>
<div
onclick="showImage('<?php echo $mainimagestab['main_images_tabs_id']; ?>', '<?php echo $mainimagestab['main_images_tab_img']; ?>')">
<span>
<?php echo $mainimagestab['main_images_tabs_tittle']; ?>
</span>
</div>
<?php endforeach;
endif; ?>
</div>
</div>
</div>
</div>
</button>
<?php $nav_counter++;
endwhile; ?>
</div>
</div>
<?php
endif;
wp_reset_postdata();
}
function gamingtab_tab_content()
{
$args = array('post_type' => 'gamingtab', 'posts_per_page' => -1);
$gamingtabPost = new WP_Query($args);
if ($gamingtabPost->have_posts()): ?>
<div class="tab-content" id="v-pills-tabContent">
<?php
$content_counter = 1;
while ($gamingtabPost->have_posts()):
$gamingtabPost->the_post(); ?>
<div class="tab-pane fade <?php echo ($content_counter === 1) ? 'show active' : ''; ?>"
id="v-pills-<?php echo $content_counter; ?>" role="tabpanel"
aria-labelledby="v-pills-<?php echo $content_counter; ?>-tab">
<div class="main-tabcont-wrapper">
<div class="gameimage-container">
<?php
$mainimagestabs_content = get_field('mainimagestabs');
if ($mainimagestabs_content):
foreach ($mainimagestabs_content as $index => $mainimagestab): ?>
<?php if ($index === 0): ?>
<div class="gameimage active" id="<?php echo $mainimagestab['main_images_tabs_id']; ?>">
<img src="<?php echo $mainimagestab['main_images_tab_img']; ?>" alt="">
</div>
<?php else: ?>
<div class="gameimage" id="<?php echo $mainimagestab['main_images_tabs_id']; ?>">
<img src="<?php echo $mainimagestab['main_images_tab_img']; ?>" alt="">
</div>
<?php endif; ?>
<?php endforeach;
endif; ?>
</div>
<div class="gamestabs-uppercont">
<?php the_content(); ?>
<div class="gamestabs-imggrid">
<?php
$imageboxes = get_field('imageboxes');
foreach ($imageboxes as $imagebox): ?>
<div class="gametabs-img active">
<img src="<?php echo $imagebox['imageboxes_img']; ?>" alt="">
<h4>
<?php echo $imagebox['imageboxes_tittle']; ?>
</h4>
</div>
<?php endforeach; ?>
</div>
</div>
</div>
</div>
<?php $content_counter++;
endwhile; ?>
</div>
<?php
endif;
wp_reset_postdata();
}
function generate_gamingtab_navigation_shortcode()
{
ob_start();
generate_gamingtab_navigation();
return ob_get_clean();
}
add_shortcode('gamingtab_tabs', 'generate_gamingtab_navigation_shortcode');
function gamingtab_tab_content_shortcode()
{
ob_start();
gamingtab_tab_content();
return ob_get_clean();
}
add_shortcode('gamingtab_content', 'gamingtab_tab_content_shortcode');
?>
Preview:
downloadDownload PNG
downloadDownload JPEG
downloadDownload SVG
Tip: You can change the style, width & colours of the snippet with the inspect tool before clicking Download!
Click to optimize width for Twitter