wp admin - How to I change the value of a custom field on the home page?

admin2025-01-07  7

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)

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)

Share Improve this question edited Apr 25, 2019 at 3:02 MeltingDog asked Apr 25, 2019 at 2:56 MeltingDogMeltingDog 1551 silver badge9 bronze badges 3
  • 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 Commented Apr 25, 2019 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 Commented Apr 25, 2019 at 3:25
  • Yeah, it should be there in the Advanced Custom Field GUI. – Fayaz Commented Apr 25, 2019 at 4:17
Add a comment  | 

1 Answer 1

Reset to default 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.

转载请注明原文地址:http://conceptsofalgorithm.com/Algorithm/1736264889a1002.html

最新回复(0)