Home › Forums › ACF PRO › ACF on Posts Page (getoption not working) › Reply To: ACF on Posts Page (getoption not working)
see my comments in your code
<?php
// set the post ID that you want to use and use it in all
// of the function calls where it is needed
// and make sure it's an integer value
$post_id = intval(get_option('page_for_posts'));
// thjis is a repeater or flex field according to the code below
// useing the_field() will output an array because a repater
// returns an array if you do not use a have_rows() loop
the_field('blog_introduction', get_option('page_for_posts'));
?>
<div id="introParagraph" class=" col-xs-12 p-y-2">
<?php
if (have_rows('blog_introduction', $post_id)) {
while(have_rows('blog_introduction', $post_id)) {
the_row();
?>
<h1 class="text-xs-left col-xs-10 col-md-offset-1 m-b-1">
<?php
the_sub_field('page_header'); ?>
</h1>
<div class="col-md-3 col-md-offset-1 col-xs-7 m-t-1">
<h3 class="text-xs-left" id="headerDescription">
<?php
the_sub_field('page_description_paragraph');
?>
</h3>
<?php
} // end while
} // end if
?>
</div>
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.