Home › Forums › Backend Issues (wp-admin) › Showing fields in page template and category.php › Reply To: Showing fields in page template and category.php
Hi John,
thank you for getting back to me, it means a lot.
I would like whatever content i enter on “Additions” page to show up, not only on Additions page, but also on category.php and single.php page.
In additions page i am using this to echo the content:
<?php
$call_to_action = get_field('call_to_action');
if( $call_to_action ): ?>
<div class="cta" style="background-image:url('<?php echo $call_to_action['image']; ?>')">
<div class="container">
<div class="row">
<div class="col-12">
<div class="card text-center">
<h1><?php echo $call_to_action['title']; ?></h1>
<h3><?php echo $call_to_action['subtitle']; ?></h3>
<a href="<?php echo esc_url( $call_to_action['link']['url'] ); ?>" class="btn btn-primary"><?php echo esc_html( $call_to_action['link']['title'] ); ?></a>
</div>
</div>
</div>
</div>
</div>
<?php endif; ?>
But since i am just starting with PHP i really dont know how to show it on those pages as well… I tried following this article https://www.advancedcustomfields.com/resources/how-to-get-values-from-another-post/ but i really dont know how to implement this…
Any help would mean a lot…
Thanks!
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.