I’ve just worked out I was using the above code on the template that is attached to the Blog template however when I added the code to the index.php template, the ACF’s were then pulled out from the corresponding ID’s page.
Thanks for your help.
Thanks very much for that. I have tried looking into this however I cannot seem to get this working. The Blog page that has been set as the static front page for the Blog has an ID of 11 however I cannot seem to grab any information from this page and display it within this template.
How would I be able to manipulate:
$query_object = get_queried_object();
in order to get the fields I need from the main blog page?
The code I am using to get the information I need at the moment is:
<?php
$testomonialOneText = get_field( "testomonial_1_text", 11);
$testomonialOneAuthor = get_field( "testomonial_1_author", 11);
$testomonialTwoText = get_field( "testomonial_2_text", 11);
$testomonialTwoAuthor = get_field( "testomonial_2_author", 11);
if($testomonialOneText){ ?>
<div id="testimonial-one<?php if (isset($testomonialOneText) && $testomonialTwoText == ''){?>-full-width<?php }; ?>">
<div class="testimonial"><?php echo the_field( "testomonial_1_text", 11); ?></div>
<?php if($testomonialOneAuthor){ ?><div class="testimonial-author"><strong><?php echo the_field( "testomonial_1_author", 11); ?></strong></div>
</div><!-- end of #testimonial-one -->
<?php
}};
if($testomonialTwoText){ ?>
<div id="testimonial-two">
<div class="testimonial"><?php echo the_field( "testomonial_2_text", 11); ?></div>
<?php if($testomonialOneAuthor){ ?><div class="testimonial-author"><strong><?php echo the_field( "testomonial_2_author", 11); ?></strong></div>
</div><!-- end of #testimonial-two -->
<?php
}};
?>
Thanks for your help.
Mark