i have posts filter after that tab code not before that
but i added wp_reset_postdata();
but stilllthings dont work
see the full page code
<?php get_header();?>
<main id="main">
<!--Breadcrumbs Section-->
<section class="breadcrumbs">
<div class="container">
<div class="d-flex justify-content-between align-items-center">
<h2><?php the_title();?></h2>
</div>
</div><!--container-->
</section> <!--Breadcrumbs Section-->
<!--departments-inner-page-->
<section id="departments" class="departments">
<div class="container">
<div class="section-title">
<h2>Departments</h2>
<p>Magnam dolores commodi suscipit. Necessitatibus eius consequatur ex aliquid fuga eum quidem. Sit sint consectetur velit. Quisquam quos quisquam cupiditate. Et nemo qui impedit suscipit alias ea. Quia fugiat sit in iste officiis commodi quidem hic quas.</p>
</div>
<div class="row">
<div class="col-lg-3">
<ul class="nav nav-tabs flex-column">
<li class="nav-item">
<a class="nav-link active show" data-toggle="tab" href="#tab-1">Cardiology</a>
</li>
<li class="nav-item">
<a class="nav-link" data-toggle="tab" href="#tab-2">Virologist</a>
</li>
<li class="nav-item">
<a class="nav-link" data-toggle="tab" href="#tab-3">Eye specialist</a>
</li>
<li class="nav-item">
<a class="nav-link" data-toggle="tab" href="#tab-4">Pediatrics</a>
</li>
<li class="nav-item">
<a class="nav-link" data-toggle="tab" href="#tab-5">Hepatology</a>
</li>
<li class="nav-item">
<a class="nav-link" data-toggle="tab" href="#tab-6">Neurology</a>
</li>
</ul>
</div><!--col-lg-3-->
<?php
$Department_tab = get_field('department_tab');
$Cardiology = $Department_tab['cardiology'];
$Virology = $Department_tab['virologist'];
$Eye_Specialist = $Department_tab['eye_specialist'];
$Pediatrics = $Department_tab['pediatrics'];
$Hepatology = $Department_tab['hepatology'];
$Neurology = $Department_tab['neurology'];
?>
<div class="col-lg-9 mt-4 mt-lg-0">
<div class="tab-content">
<div class="tab-pane active show" id="tab-1">
<div class="row">
<div class="col-lg-8 details order-2 order-lg-l">
<h3> <?php echo $Cardiology['header'];?></h3>
<p class="font-italic">
<?php var_dump($Cardiology); ?>
<?php echo $Cardiology['sub_header'];?></p>
<p><?php echo $Cardiology['body_text'];?>
</p>
</div><!--col-lg-8-->
<div class="col-lg-4">
<img src="<?php echo $Cardiology['image'];?>" alt="department" class="img-fluid">
</div><!--col-lg-4-->
</div><!--row-->
</div><!--tab-pane-->
<div class="tab-pane fade" id="tab-2">
<div class="row">
<div class="col-lg-8 details order-2 order-lg-1">
<h3><?php echo $Virology['header'];?></h3>
<p class="font-italic">
<?php var_dump($Virology); ?>
<?php echo $Virology['sub_header'];?></p>
<p><?php echo $Virology['body_text'];?>
</p>
</div><!--col-lg-8-->
<div class="col-lg-4">
<img src="<?php echo $Virology['image'];?>" alt="department" class="img-fluid">
</div><!--col-lg-4-->
</div><!--row-->
</div><!--tab-pane-->
<div class="tab-pane fade" id="tab-3">
<div class="row">
<div class="col-lg-8 details order-2 order-lg-1">
<h3><?php echo $Eye_Specialist['header'];?></h3>
<p class="font-italic">
<?php echo $Eye_Specialist['sub_header'];?></p>
<p><?php echo $Eye_Specialist['body_text'];?>
</p>
</div><!--col-lg-8-->
<div class="col-lg-4">
<img src="<?php echo $Eye_Specialist['image'];?>" alt="department" class="img-fluid">
</div><!--col-lg-4-->
</div><!--row-->
</div><!--tab-pane-->
<div class="tab-pane fade" id="tab-4">
<div class="row">
<div class="col-lg-8 details order-2 order-lg-1">
<h3><?php echo $Pediatrics['header'];?></h3>
<p class="font-italic">
<?php echo $Pediatrics['sub_header'];?></p>
<p><?php echo $Pediatrics['body_text'];?>
</p>
</div><!--col-lg-8-->
<div class="col-lg-4">
<img src="<?php echo $Pediatrics['image'];?>" alt="department" class="img-fluid">
</div><!--col-lg-4-->
</div><!--row-->
</div><!--tab-pane-->
<div class="tab-pane fade" id="tab-5">
<div class="row">
<div class="col-lg-8 details order-2 order-lg-1">
<h3><?php echo $Hepatology['header'];?></h3>
<p class="font-italic">
Qui laudantium consequatur laborum sit qui ad sapiente dila parde sonata raqer a videna mareta paulona marka</p>
<p>Et nobis maiores eius. Voluptatibus ut enim blanditiis atque harum sint. Laborum eos ipsum ipsa odit magni. Incidunt hic ut molestiae aut qui. Est repellat minima eveniet eius et quis magni nihil. Consequatur dolorem quaerat quos qui similique accusamus nostrum rem vero
</p>
</div><!--col-lg-8-->
<div class="col-lg-4">
<img src="assets/image/departments-5.jpg" alt="department" class="img-fluid">
</div><!--col-lg-4-->
</div><!--row-->
</div><!--tab-pane-->
<div class="tab-pane fade" id="tab-6">
<div class="row">
<div class="col-lg-8 details order-2 order-lg-1">
<h3><?php echo $Neurology['header'];?></h3>
<p class="font-italic">
Qui laudantium consequatur laborum sit qui ad sapiente dila parde sonata raqer a videna mareta paulona marka</p>
<p>Et nobis maiores eius. Voluptatibus ut enim blanditiis atque harum sint. Laborum eos ipsum ipsa odit magni. Incidunt hic ut molestiae aut qui. Est repellat minima eveniet eius et quis magni nihil. Consequatur dolorem quaerat quos qui similique accusamus nostrum rem vero
</p>
</div><!--col-lg-8-->
<div class="col-lg-4">
<img src="assets/image/departments-5.jpg" alt="department" class="img-fluid">
</div><!--col-lg-4-->
</div><!--row-->
</div><!--tab-pane-->
</div><!--tab-content-->
</div><!--col-lg-9-->
</div><!--row-->
</div><!--container-->
</section>
<!--doctors-inner-page-->
<section id="doctors" class="doctors">
<div class="container">
<div class="section-title">
<h2>Doctors</h2>
<p>Magnam dolores commodi suscipit. Necessitatibus eius consequatur ex aliquid fuga eum quidem. Sit sint consectetur velit. Quisquam quos quisquam cupiditate. Et nemo qui impedit suscipit alias ea. Quia fugiat sit in iste officiis commodi quidem hic quas.</p>
</div><!--section-title-->
<div class="row">
<?php
$args = array(
'post_type' => 'doctor',
'posts_per_page' => 4
);
$doctors = new WP_Query($args);
while($doctors->have_posts()){
$doctors->the_post();
?>
<div class="col-lg-6 mt-4 mt-lg-0">
<div class="member d-flex align-items-start">
<div class="pic">
<img src="<?php the_post_thumbnail_url('post_image'); ?>" class="img-fluid" alt="doctor">
</div><!--pic-->
<div class="member-info">
<h4><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h4>
<span><?php the_field('doctor_subheading'); ?></span>
<p><?php echo wp_trim_words(get_the_excerpt(),10);?></p>
<div class="social">
<a href=""><i class="ri-twitter-fill"></i></a>
<a href=""><i class="ri-facebook-fill"></i></a>
<a href=""><i class="ri-instagram-fill"></i></a>
<a href=""><i class="ri-linkedin-box-fill"></i></a>
</div><!--social-->
</div><!--member-info-->
</div><!--member-->
</div><!--col-lg-6-->
<?php } wp_reset_postdata(); ?>
</div><!--row-->
</div><!--container-->
</section><!--doctors-->
</main>
<?php get_footer();?>
ok i got this solved
i added wp_reset_postdata() after emergency custom post type
I just checked wp_postmeta it has some 5000 rows generated mostly because of acf as i was using the same wp installation to try acf on seveal wp themes so i decided to try a fresh wp install and setup the theme there..hope that will work..thanks
hi
I just checked the wp databse
and run this query
SELECT * FROM wp_postmeta WHERE meta_key LIKE '%video%'
and you can see the video field does have data
see screenshot
Hi
before you say that i just tried creating a new field group
with new sub field names
$video2 = get_field(‘video2’);
and its var_dump also retuns null
www\wordpress\wp-content\themes\Mediqas\front-page.php:65:null
i feel lost :\
i have no other fields in database with tht name
www\wordpress\wp-content\themes\Mediqas\front-page.php:62:null
see this
i re added the group few times but see same result
but i use two other groups on same page
and they show fine
and this is one of the other groups
var_dump($hero)
shows the array
array (size=4)
'main_title' => string 'WELCOME TO MEDIQAS' (length=18)
'small_title' => string 'Devoted to medicine excellence for 10 years' (length=43)
'link_text' => string 'GET STARTED' (length=11)
'link' => string 'http://localhost/wordpress/why-us/' (length=34)
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users
Helping others is a great way to earn karma, gain badges and help ACF development!
We use cookies to offer you a better browsing experience, analyze site traffic and personalize content. Read about how we use cookies and how you can control them in our Privacy Policy. If you continue to use this site, you consent to our use of cookies.