ACF pro Wordpress

Is it possible to create a field that could be used on all pages and posts but still being able to change to content on one, but not on all pages? For eg. I want to create a field for a header image that displays on all pages and posts (except homepage), but I want to be able to change the image on particular page, I don't want them to change simultaneously on all of them. Makes sense? Ideas?
7 Replies
lko
lko4mo ago
If i'm not wrong you should create a new field then set it to "content > pages" I dont remember exactly what it's called, and then do `<?= get_field("xyz") ?> in php as usual
Smix
SmixOP4mo ago
I tried that, no luck.
ἔρως
ἔρως4mo ago
why don't you create a field in the settings page that you can use anywhere, and then create a specific field for the pages and posts? basically, you have 2 fields, instead of 1 and then you get the value of the current post/page, and, if it doesn't exist, you can get the settings value
Smix
SmixOP4mo ago
Tnx guys, I managed it. Works fine.
ἔρως
ἔρως4mo ago
what did you do?
Smix
SmixOP4mo ago
In ACF I created one group with subfield, set the rules to display on post and page template except the homepage, added the same php code in all templates and it works independently as I wanted. Dunno why I was confused in the first place. Maybe there is better way to do it, but if it works, don't touch it 😂
ἔρως
ἔρως4mo ago
oh, that's completely different from what i understood
Want results from more Discord servers?
Add your server