Support

Account

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!