jeudi 29 août 2019

advanced custom fields true/false only works in front-page.?? not in innerpages why?

i have a acf true or false based if condition for to show a section based on the mentioned code. it works correctly in the front page/homepage of the WordPress. but it doesn't works in the inner pages, not getting the values of the field and i use this code in footer templates.

its a WordPress site with latest version. and the code is in the footer template

<?php 
$show_company_info = get_field( "show_company_info", get_the_ID() );
if($show_company_info ): 
?>
<section class="company">
  <div class="container">

      <?php if ( is_active_sidebar( 'company-info-widget' ) ) : ?>
      <?php dynamic_sidebar( 'company-info-widget' ); ?>
      <?php endif; ?>

  </div>
</section>
<?php endif; ?>

if we checked the acf true/fields condition in any page it will show the section otherwise not. but it actually works in homepage only

Aucun commentaire:

Enregistrer un commentaire