All you have to do is to use if statement correctly in your code:
<?php if (get_field('youtube_video_1')) : ?>
<!-- Media/YouTube Video Section -->
<div class="resourcespdf">
<h2 class="customresourcespdf">Media</h2>
</div>
<div class="embed-containerone">
<?php the_field('youtube_video_1'); ?>
</div>
<?php endif; ?>
Related Posts:
- How to use copy() function and paste file in /wp-content/themes directory
- Am I not understanding plugins?
- Using Font Awesome as post thumbnail
- Why WordPress architecture is not pure object oriented and it don’t use MVC pattern? [closed]
- custom shortcode will not display the wrapped content
- How can i upload images in an admin page?
- Hide categories that are not used in the post type
- How to set up VS Code for WP plugin/theme development in 2021? [closed]
- what is the best practice to add new field to an api route
- Improve page speed loading using CDN and async or defer attribute
- How to obtain the current website URL in my theme?
- What exactly do this function declared into functions.php file of a WP theme?
- zip unzip attachments in wordpress
- How to add the sidebar to all the pages except the home page? [closed]
- Validate and Sanitize WP REST API Request using WP JSON Schema?
- How can I search all plugins for composer’s vendor/autoload.php?
- Removed jQuery script from header.php , any problems?
- Toolbar Hidden in a Virtual Page
- How to extend SelectControl with data from my theme
- How to change basename url for wp-admin?
- Submit remote form to wordpress REST API and save data to custom post type
- Store user form submitted information in post type
- Display attached images of a page or post that are insetred using gallery
- Add a custom link to each image in WordPress gallery
- register dependency css and js inside a plugin class
- How to properly escape in ternary operators – Wp Coding Standards?
- WP multisite network plugin fails to see classes loaded with spl autoload
- How to edit the default database of WordPress [closed]
- Variable ++ in query loop
- Woocommerce Convert existing order to the cart
- Capture the Selected Radio Button Value between two files in wordpress theme
- How to determine if WP_DEBUG is enabled? [duplicate]
- Custom plugin: Trying to show saved data on frontend
- Get author full name
- Fatal error: Call to undefined function plugin_dir_path()
- How to make WordPress plugin check for database changes and then do something?
- Is it possible to get a theme customizer setting from wp.customize using jquery?
- Update Multiple Post Meta for the Same Post In One call?
- One button to change all settings in theme customizer?
- Show different Customizer Settings on Page-Tamplates
- How do I list the_tags() into HTML data-attribute
- Problem with WordPress Ajax form
- admin-ajax.php responding with 0
- How to restrict wp generate attachment metadata() to certain intermediate image sizes
- Common abstract class for plugins
- Using a variable in is_page(array())
- Same log message keeps on printing to debug.log file thousand of times
- Trigger popup in a php if/else statement
- Anyway to output the registration form like the login form with wp_login_form()?
- Where to edit the template that is generating the code for dynamic_sidebar left-sidebar in the Understrap theme? [closed]
- How can I create a list of page titles from custom meta values?
- How to select the contents in the text view textrea in wp_editor?
- I have a problem in the order of enqueues while enqueuing stylesheets and scripts for a specific page in my function.php
- I want to add custom add to cart link [closed]
- Execute long and heavy processes
- Why in my theme I can’t see all the statics content under the posts?
- Theme not calling Jquery properly
- Usage of call back function of add_meta_box()
- Double Curly Brackets in Php
- How to Schedule Cronjobs for start of every month and year
- Get post categories
- Output only links using wp_nav_menu()
- How to correctly load a different version of main menu based on the user language in WordPress? Is it a good solution?
- How can I get plugin meta data without knowing the plugin folder?
- calling admin-ajax.php from admin-ajax.php
- WordPress redirects page query parameter in URL
- Flatten Responses returned via WP REST API via WP_Error for obfuscation
- Need help for some PHP code
- How do you get the current post taxonomy so I can get the current post taxonomy? into a variable to THEN loop through all post with that taxonomy.,
- how to replace h1 entry title with h2 in category pages only
- Problem with displaying CSS Stylesheets – Am I adding them correctly in my wordpress child theme?
- Display post date also if the date it’s the same for each post
- Foreach Loop Of Post Types With Nested If Else If Not Completing Process
- In a foreach loop, how can I add a meta value if it doesn’t exist?
- Looping through and combining calls to Woocommerce REST API
- Should I use wp_cache in my plugin to make it faster?
- How to access this jQuery/AJAX data in a PHP file/WordPress plugin
- post_exists stops working in a scheduled event
- When I create a new custom post type, it replaces the old post type
- Collapsible menu on post sidebar only expands and does not collapse
- Add .php to end of all WordPress Pages (multisite)
- Woocommerce variable products are being added to the card on the homepage (ajax)
- PHP get_category() function redeclared
- How to get php file based on URL in WordPress
- Getting Member Data From WhishList Member on Register
- I’m writing my first plugin and my echo output is showing up on every page of my wordpress installation
- global $post inside plugin query messes up every new post page in wp-admin
- PHP calling function within a class
- A Customizer checkbox control that sets the setting to “” or to “blank” and show() or hide() a color control
- Save data of select list after clicking save
- Image not displayed
- Create and update Custom Cookie based on multiple GET and POST Values for first time visitors?
- Adding code to the function file
- Can’t remove menu items added by plugin
- Issues separating my Plugin pages into different files
- Custom field fetch error on woocommerce pdf invoice
- How to hide header and footer from page template
- how to check elementor is widget is active or loaded
- Adding features to Gutenberg without theme.json
- Cannot Access ACF Field Values via my Plugin