Home › Forums › Front-end Issues › ACF fields on a static set posts page › Reply To: ACF fields on a static set posts page
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
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.