Home › Forums › Front-end Issues › Get values from another page that has flex
I’m not sure if this is possible – but, I have flex content on a page called ‘recent_work’ which works fine.
I want to include that section near the footer so it pulls through whenever someone clicks a particular button.
This is my code so far, I follow this link here but even with 7017 (page number) – it doesn’t work…
<?php $post_id = 7017; ?>
<?php if( have_rows('recent_work') ): ?>
<div class="work">
<?php while( have_rows('recent_work') ): the_row(); ?>
<?php
$post_id = get_sub_field('work', false, false);
if( $post_id ):
?>
<div class="work__single">
<a href="<?php echo get_the_permalink($post_id); ?>" class="single_img" style="background-image:url('<?php the_field('preview_image', $post_id); ?>');">
</a>
<div class="single_cont">
<a href="<?php echo get_the_permalink($post_id); ?>"><h3><?php echo get_the_title($post_id); ?></h3></a>
<p><?php the_field('client_subheading', $post_id); ?></p>
<?php
$featured_posts = get_field('services', $post_id);
if( $featured_posts ):
?>
<ul class="services_points">
<?php foreach( $featured_posts as $post ):
// Setup this post for WP functions (variable must be named $post).
setup_postdata($post); ?>
<li>
<a href="<?php the_permalink(); ?>"><?php the_title(); ?></a>
</li>
<?php endforeach; ?>
</ul>
<?php
// Reset the global post object so that the rest of the page works correctly.
wp_reset_postdata(); ?>
<?php endif; ?>
</div>
</div>
<?php endif; ?>
<?php endwhile; ?>
</div>
<?php endif; ?>
<?php wp_reset_query(); ?>
You must be logged in to reply to this topic.
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.