0

I'm new to WordPress and have inherited a site that uses Custom Fields.

In header.php there is;

<?php if(is_front_page()) : ?>
  <div class="row">
    <div class="col-md-4 header-banner__text">
      <?php print get_field('home_banner_text'); ?>
   </div>

I want to update whatever the value of home_banner_text is.

I can see it in the Custom Fields settings area, but I can't see where it's actual set anywhere.

Would anyone know how this is done?

(PS I've looked into the Appearance >> Header tab but that does not have the same Custom Fields)

  • Looks like it's done by ACF's get_feild function. If that is the case, then you'll be able to update it using the update_field function or from ACF's menu. If all else fails, you can edit it directly from the database in the wp_postmeta table. – Fayaz Apr 25 '19 at 3:18
  • @Fayaz but surely theres a way to update it via the GUI? I can't ask my users/new site owners to make code/DB changes every time they need to update the banner image – MeltingDog Apr 25 '19 at 3:25
  • Yeah, it should be there in the Advanced Custom Field GUI. – Fayaz Apr 25 '19 at 4:17
0

You can change the value for home_banner_text as follows.

  1. Make ACF field visible on homepage admin area Go to Custom Fields -> Field Groups. Find field group which has the home_banner_text field. In that field group, scroll down to Location tab/section. Update in Show this field group if, Page is equal to Your Home/Front Page

  2. Go to Pages-> Your Home/Front page. in that page, scroll down until you see the option to update your desired value.

That's it.

| improve this answer | |
  • Thanksm but still no luck - it does not appear when I go to edit Front Page – MeltingDog Apr 25 '19 at 5:18
  • can you show me a screenshots of your ACF page and frontpage admin areas? – Vishwa Apr 25 '19 at 5:27
  • here's what I have set on my ACF page, and here is what appears when I go to the Landing Page page and scroll to the bottom (these are other ACF groups) imgur.com/a/0k9dSvb – MeltingDog Apr 25 '19 at 6:06
  • you sure your home page name is landing page? if so, then it should be there. also try expanding screen options and check whether it's enabled your ACF group's visibility there – Vishwa Apr 25 '19 at 6:27

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.