Home Forums Front-end Issues Get values from another page that has flex


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(); ?>    
                $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); ?>');">
        			<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>
    						$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); ?>
    					            <a href="<?php the_permalink(); ?>"><?php the_title(); ?></a>
    					    <?php endforeach; ?>
    					    // Reset the global post object so that the rest of the page works correctly.
    					    wp_reset_postdata(); ?>
    					<?php endif; ?>
            <?php endif; ?>      
        <?php endwhile; ?>
    <?php endif; ?> 
    <?php wp_reset_query(); ?>   
Viewing 1 post (of 1 total)

You must be logged in to reply to this topic.