Home › Forums › General Issues › Use the same content on multiple pages › Reply To: Use the same content on multiple pages
There is another dead simple way to do this without an options page (but using an option page for items displayed throughout the site, like footer info, can provide a more logical place for clients to enter things).
Here is an example of a field displaying a newsletter link on the homepage:
<?php the_field( 'newsletter'); ?>
Here is the same code but modified to display in the side bar of all other pages of the site:
<?php the_field( 'newsletter', 2 ); ?>
The “2” is the post ID of the homepage – that’s it!
FYI this is hardcoded into my custom theme files.
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.