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
- How to determine if WP_DEBUG is enabled? [duplicate]
- Custom plugin: Trying to show saved data on frontend
- Get author full name
- How to export/import theme customizer settings?
- 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?
- One button to change all settings in theme customizer?
- How can I add a class to a single menu item?
- Show different Customizer Settings on Page-Tamplates
- How do I list the_tags() into HTML data-attribute
- allow user to select pages from dropdown in my plugin
- How to set a custom path, for ajax image upload folder in admin?
- 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()?
- Create onClick Event to Re-load a Widget
- Accessing the database from a plugin outside of action hooks
- Adding subdomain to home_url for “add_menu_page”
- 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?
- get_the_tags() not iterating through for/while loop, but will with foreach
- post created but no permalink
- I want to add custom add to cart link [closed]
- Execute long and heavy processes
- Trying to retrieve post meta
- Redirect to another page using contact form 7? [closed]
- Custom plugin settings link doesn’t append current class to menu item when visited? Why?
- How to set up a If is_singular statement?
- How to hook code to show after the_content?
- Underscore – Self hosted fonts
- Using and saving custom dropdown boxes on user profiles
- Get title attribute from galleries
- How can I use a sliced image As banner? [closed]
- Can a plugin redirect product page based on IF condition?
- How to make function appear in sentence?
- Save html content of a widget textarea
- Widgets not showing on custom theme
- Get all posts as an array ID => Name
- Why does my settings form redirect to the homepage?
- How to modify mobile nav menu text in theme
- Woocommerce custom Plugin in wordpress [closed]
- How to get my [shortcode] rendered on the home page, other pages are fine
- Using php inside javascript [closed]
- Post form – AJAX won’t upload featured image – Plugin development
- WordPress single.php get_header not working
- Unable to retrieve get_author_posts_url
- ACF relationship on user profile page used for allowed access
- Problem with my Login Plugin
- How to return html as a string from php for WordPress
- Taxonomy Child Term, Counter is staying on 0
- Need help with format of nested array in MySQL
- How to add delete, approve, spam Links to Comments
- Help on Wp_query to print an term
- Upload images from one server to an other in wordpress
- PHP: Why does my code work in index.php but not a widget?
- How to use Amazon Elastic Transcoder from WordPress using AWS SDK for PHP?
- Not able to get the exact URL of the file on server located in active wordpress theme
- Accessing Variables Used In a Plugin Using PHPStorm + XDebug
- Can anyone tell me why I can’t edit a plugin when it is installed without having to re-install?
- Using is home to get content [closed]
- How I can give a php page a style from my theme
- How do I change the Go To Categories link in the term_updated_messages
- Redirect posts to post editor page based on query string
- WordPress PHP8 Critical Error in class-wp-widget.php
- Load style and script for custom post type metabox
- Permissions error when I use my plugin to delete comments in the front-end