Home › Forums › General Issues › Show text field data in footer(get_footer)
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
.
actully in step 3. 3 then tried to access the data using, ” But this not worked.
Hi Darpan,
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.
Hi @Darpan
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:
http://www.advancedcustomfields.com/resources/how-to/how-to-get-values-from-another-page/
Does this help?
Hi @Darpan
Sorry mate, I’m not following what the issue is.
You have a page for all your social data. This is acting as a ‘static’ page and has an ID of 87, arn’t you trying to always show the ‘static’ social data from p 87 on all page’s footer?
footer is single page which is included in every page,
<?php get_footer() ?>
Hi @Darpan
Sorry, I am still confused.
Footer is not a page, but yes it is included on every page. That is the role of a footer.
Can you please re explain your issue clearly?
Is the issue with your code:
$instance['87']
Shouldn’t it jst be 87?
As in
<?php the_field('facebook_url',87); ?>
please how can i use advanced custom field to edit my footer in wordpress?
The topic ‘Show text field data in footer(get_footer)’ is closed to new replies.
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.