Move the outer(of the two) div.local_faq
inside the if statement which checks if the faq field is set, because that’s the outer parent container. Also it would make sense to change the outer container div to have a plural div.local_faqs
class instead of the same class as the nested div.local_faq
Then just add the h3 part inside the outer div.local_faqs
and the faqs and header will only show if the field is set:
<?php if (get_field('local_faq')) : ?>
<div class=“local_faqs”>
<h3 class="local_faq" style="text-align: center; font-size: 50px;"><?php the_title(); ?> Dumpster Rental FAQs</h3>
<?php while (the_repeater_field('local_faq')) : ?>
<div class="local_faq" style="margin-left: 100px; margin-right: 100px;">
<h4><?php the_sub_field('question'); ?></h4>
<p><?php the_sub_field('answer'); ?></p>
</div>
<?php endwhile; ?>
</div>
<?php endif; ?>
Related Posts:
- How can I create a list of page titles from custom meta values?
- Need Help Fixing My Iframes [closed]
- Two queries for a WP_User_Query search work perfectly apart, but not together
- Trying to retrieve post meta
- What syntax is this? “{{post.price}}”
- Create another “Display Site Title and Tagline” checkbox, “Header Text Color” setting and control
- Add child pages of parent to navbar PHP
- Load a page into a div with Ajax
- Custom theme: Alternatives to long list of ‘include’ in functions.php
- Passing the custom field values in the wp_get_current_user array function
- Theme Options Page – User Updates Logo
- Converting HTML Template to WordPress Theme
- Sort posts by custom fields value using dropdown menu
- How to use my style.css file outside of wordpress subdomain?
- How to show part of the_content?
- Wp-login appears White Screen, Error: Cannot modify header information
- Custom profile field with birthday. Troubles with
- How to remove the cufon script from Dzonia Lite theme [closed]
- get_the_tags() not iterating through for/while loop, but will with foreach
- WordPress – Display array data of a child
- Query & Order posts by custom fields
- Hide categories that are not used in the post type
- How do I add custom bulk actions to multiple custom post types?
- Add_action not working in required file of functions.php
- How to set up VS Code for WP plugin/theme development in 2021? [closed]
- wordpress allow user to edit user profile with custom fields
- Why do WP_Query results change after updating unrelated Advanced Custom Fields (ACF)?
- adding custom user input fields in WordPress admin dashboard gives error The link you followed has expired. Please try again
- what is the best practice to add new field to an api route
- Store multiple custom field as post meta per post(css, js, html, 2 link) [closed]
- Grab posts by multiple categories
- Can’t access variable outside for loop
- I have a problem in the order of enqueues while enqueuing stylesheets and scripts for a specific page in my function.php
- add custom link to wordpress media gallery modal
- How to VAR_DUMP a $variable during checkout process (Is my product meta callable?)
- Avoid parallax images hardcoding
- Improve page speed loading using CDN and async or defer attribute
- Firing schema via code in functions.php doesn’t work
- Adding number to date not working [closed]
- populate form fields in a loop with ajax
- How can I add extra word in permalink when someone click download button?
- Error in custom php function doesn’t exist
- Customizer: active_callback and sanitize_callback incompatibility?
- Saving and Restoring a Canvas on A Individual User Basis
- post created but no permalink
- Seach custom post type posts only by meta fields?
- How to use thumbnail size of image if I’m only using src to get image
- 3 Slashes appear after Apostrophe in custom fields after updating product-site
- Populate editor with some content of a page with a page template
- how to retrieve a value if a checkbox is checked
- Trouble checking if custom woocommerce checkout field is empty or not
- Recent Posts Not Showing Only On A Specific Category Page [closed]
- Catchable fatal error: Object of class stdClass could not be converted to string after WP 4.7
- Menu jumping when calling it via PHP
- Displaying recent posts on static page with template-part via shortcode
- auto-populating custom nav with all items from custom post type
- How to edit widget code to add unique class name to each div?
- Compare the old get_theme_mod($name) to the new get_theme_mod($name) return value
- Skt full width basic slideshow problem
- Add / Update Custom Fields After Select Pictures in Media Window
- conditional logic for front-end custom field edits
- How to disable controls in theme customizer?
- How do I link a button I created in theme customizer to a function?
- Automatic Shortcode Creation with Custom Fields [closed]
- Custom field values to taxonomy terms
- can i fetch a custom metabox data in another page or post type?
- Is there a way to conditionally check whether a WordPress post title is empty?
- How would an if statement surrounding a custom field with two variables (holding values) look like?
- Is the “_s” on this `sprintf(__(‘Page %s’, ‘_s’), max($paged, $page))` just refer to a text domain?
- Redirect to another page using contact form 7? [closed]
- get_template_part for specific page
- How do I create my own .php file with a code part and echo it on different pages?
- How to add specific meta tags to head of cart and checkout pages in woocommerce?
- Custom Field IF/ELSE PHP
- How to remove woocommerce_breadcrumb() from do_action( ‘woocommerce_before_main_content’ ); [closed]
- ‘Post-thumbnails’ feature does not seem to register
- if statement with is_active_sidebar()
- Which PHP page is the Default Posts Page
- WordPress admin-ajax.php
- Use .php file as page instead of wordpress page & template file?
- How to combine 2 php functions into one function with a custom field
- Remove the last X characters of a custom field value
- Advanced Custom Fields – display label and value only if value entered
- Use WordPress function in php file
- Is it possible to retrieve all posts with a certain value for metadata?
- What does this mean in wordpress? Easy question
- How to obtain the current website URL in my theme?
- Syntax error when I try to insert my loop into an unordered list? [closed]
- What exactly do this function declared into functions.php file of a WP theme?
- Admin ToolBar not being displayed at top of site
- Saving zero in meta box
- Royalty-Free Sliders used in theme development
- Non-Closing PHP Query in WordPress Loop
- Why am I getting a different filename? And how does WordPress load singular.php for both Page & Post? (Fresh WordPress installation)
- How to set up a If is_singular statement?
- Find a way to retrive data updated through metabox plugin to web page
- Reason to add a name of the theme like (‘menu-1’ => __( ‘Primary’, ‘twentynineteen’ ),) in PHP?
- Underscore – Self hosted fonts
- Separation of presentation and code – WordPress
- Why are the details of my todo not saving?