I created wp-theme, use plugin Custom Post Type UI.
Created sections - Customers
and Projects
.
In page-projects.php, display list (links) all of customers:
$args = array(
'post_type' => 'customer'
);
$the_query = new WP_Query( $args );
Im trying to display content from post projects
(about customer).
Page single-customer.php
display content from customers
, but I need post from projects
.
How get this post content? Its possible?
UPD
code in single-customer.php
:
`<div class="page-head text-center">
<div class="container">
<h1 class="page-head_title"><?php the_title(); ?></h1>
<p><?php the_subtitle(); ?></p>
</div>
</div>
<?php
// This is for projects posts
$args = array(
'post_type' => 'project'
);
$the_query = new WP_Query( $args );
?>
<?php if ($the_query->have_posts()) : ?>
<?php while ($the_query->have_posts()) : $the_query->the_post(); ?>
// loop here
<?php the_title(); ?>
<?php the_content(); ?>
<?php endwhile;
wp_reset_postdata();
else : ?>
<p><?php _e( 'Sorry, no posts matched your criteria.' ); ?></p>
<?php endif; ?>`
UPD
if i use this code <?php acf_form(); ?>
its display content which i need, but its display all textarea and inputs of wp-admin panel. if i use <?php the_field('project-sections'); ?>
- its display Array, Array, Array, Array