Maybe you’re not getting an error, if there is no error at all, but just a misunderstanding?
By default, without custom coding, is_page_template() will only work on posts/pages where the Post Meta “_wp_page_template” is set. You can set this value in the Page Attributes Metabox when editing a Post. You can enable this by enabling “page-attributes” through add_post_type_support().
Maybe this Post Meta value is missing on the page’s you expect the Hero / Section to show.
Hope this helps.
Related Posts:
- How to import CSV into Custom Post Type custom fields?
- ACF – get fields from group
- How to get “Additional CSS Class” for ACF Gutenberg block
- Advanced Custom Fields select field : How to echo the label, not the value? [closed]
- ACF: get_field() returning false [closed]
- Adding custom fields to the header.php
- How to get_terms() only of terms matching an ACF meta value?
- Query between dates using Date Picker fields
- Advanced custom field – gallery – display one random image
- Showing an ACF field in admin posts dashboard
- Google Places API With ACF [closed]
- Check for the existence of custom field
- ACF Repeater Field, need IF statement for if sub field has content
- Can not create fields in ACF with code
- Advanced Custom Fields – Check if multiple get_fields exist?
- ACF – Custom fields have dissappeared [closed]
- Error in Validate Field with ACF plugin in WordPress
- disable (read only) a field if within a custom post type name
- How to change the page title from functions.php
- Acf Pro repeater field returns null [closed]
- Insert Commas into ACF number field
- How I can check if get_theme_mod is in header or a template part
- Using pre_get_posts for meta value of LIKE comparison on ACF repeater sub field
- WP Rest endpoint with custom post type and ACF Fields
- Advanced custom fields: Customise date picker’s start date (need to choose year 1500 onwards) [closed]
- My get_terms not working for custom fields
- Updating the database with advanced custom fields
- How to share repeated fields across multiple pages?
- ACF: replace comma with another sign [closed]
- Remove headings option from Wysiwyg editor from ACF in a certain custom post type
- Organize media library into folders and get folders via WP Rest API?
- ACF (Advanced Custom Fields) not updating post or postmeta values
- Remove YoastSEO meta description from output/source [closed]
- Advanced Custom Fields changes get stuck in cache
- WordPress Date with ACF
- ACF Multiple Checboxes Output
- Filter posts by advanced custom field
- Insert Content into Script with Advanced Custom Fields
- Migrating data from ACF to WordPress custom meta boxes
- Get image data from advanced custom field [closed]
- Check for image with same filename but different extension
- ACF: Querying relationship fields with Author
- How to get both image attachment ID and url
- Function wp_enqueue_style was called incorrectly
- how make file upload field through custom field
- ACF Clone Field – Set Default Value
- ACF save json to custom directory not working, default acf-json used instead
- ACF URL behavior, duplicating links
- Advanced Custom Fields oembed only outputs YouTube URL
- Do comparision after updates hooks of acf-fields?
- Importing ACF code in other page templates
- ACF Content with WPML not saving [closed]
- Order get_terms by multiple meta_values
- How do you display a custom field on a new page? [closed]
- Hash password field to database, unhash in admin?
- Pulling in content from another page [closed]
- Advanced Custom Fields – Check multiple Empty Fields [closed]
- Simple Calendar
- How to only show ACF field if another block is being used?
- ACF Select Field can’t return Array
- Advanced Custom Field Textarea not Showing (ListingPro Theme)
- Using the WP CLI to output the HTML results of calling a post?
- Image is displaying with the url of the image as well
- How to add a custom field for image in “Text and Full Image(text right)” layout?
- Trying to add ACF to authors meta and adding a class at the same time
- Fill up advanced custom field of a custom post type via API REST POST
- Two problems that are likely related to AJAX
- Fancybox3 ACF repeater. URL strip out from the caption field
- ACF – Eliminate unnecessary data and print
- Is it okay to use an ACF field to store a password for a protected area of a page?
- Get values from an advanced custom field
- ACF Map with custom styles field
- Front End User Registration – How to Save ACF Values?
- Which is faster: Loading images from the repo, or loading them using ACF Image Content via Media Library
- ACF don’t save the selected value
- help with really simple csv importer
- Advanced Custom Fields Gallery and Flex Slider [reformuled]
- WordPress API response filter by ACF value
- ACF Pro Date Picker not coming through on Loop
- Convert number to date format within an array
- ACF not updating value correctly
- ACF Repeater and Sort
- How to display dropdown filters for posts
- Creating a page from acf fields
- Use an image’s url as argument in update_field function
- Add a mailto button next to custom field download link
- Pin to Top Functionality using orderby custom field then event date
- Update the value of every page’s content editor with the value of an Advanced Custom Field on that page
- WordPress loop based on url sting
- Array sorting by custom field date
- Advanced Custom Fields repeter field expiration
- Conditional Custom field with foreach
- Post Image alt text not appearing in WordPress website
- meta_query for an ACF checkbox field don’t works correctly
- Use Advance Custom Fields to fill text widget [closed]
- ACF gallery & bootstrap colls and rows [closed]
- ACF – if field has value within Field Group conditional statement [closed]
- Create WhatsApp URL dynamically using ACF Pro from different fields
- ACF: register subfields for existent parent “group” field depend on other fields post data with PHP
- Copy nested ACF Flexible Content row from one page to another