I want to update the footer social icons links using the text field of ACF
What I done is,
1. Create a new field group called ‘Social Links’,
2. Add new field named ‘Facebook Url’,
3 then tried to access the data using,
<a href="<?php the_field('twitter_url'); ?>" But this not worked.
4. Then I accessed data using
<?php the_field('facebook_url',$instance['87']); ?> This worked but only for home page, when I opened other page the links showing current page url
So, please tell me what mistake I done, and what is the solution for this issue..
And important Rule=
page is equal to Social Links.
It seems like you are trying to show a page-specific field on every page on the site, would that be right?
The Options Page extension will help you here. This allows you to display a field on any page of the site, added into one site-wide options page. This is the opposite of adding fields to pages, that’ll only be accessible when the page is being shown; hence why when you added the post ID to your code, it worked.
To load data from a specific page, you need to use the $post_id parameter to target the location of where the data is saved.
You can read more about this here:
Does this help?
footer is single page which is included in every page,
<?php get_footer() ?>
Is the issue with your code:
Shouldn’t it jst be 87?
<?php the_field('facebook_url',87); ?>
<?php the_field('facebook_url',87); ?> this works.
You must be logged in to reply to this topic.
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!
If you haven’t seen it yet, you should check out @SandhillsDev’s slick new website! Three years in and laying roots for the future, I’ve never been more proud to work for a company than I have for this one.https://t.co/cvywHuTZAC pic.twitter.com/myeA5GLAEq— Drew Jaynes (@DrewAPicture) September 13, 2019
© 2019 Advanced Custom Fields. Subscribe