Just a simple php if
to check the contents of the field before outputting markup.
<?php
if( $second_comment = get_field('second_content_block') ){
?>
<div class="page-content-text-additional">
<?php echo do_shortcode("[vr_jsp] $second_comment [/vr_jsp]"); ?>
</div>
<?php
}
?>
You can eliminate the need for adding the class via js using the same method.
Some friendly advice- spending a day reading the php documentation will make your life much easier 🙂
Related Posts:
- Write text below a specific part of a sentence
- How to insert html/css/javascript code to wordpress plugin
- How to integrate my HTML and javascript into my child theme
- How to create fa-bars animated menu
- How can I get the search form to be selected automatically?
- Cannot set property ‘className’ of null at setThemeFromCookie
- How to Add a Read-only Textbox With Text in it That Has a Button to Copy it?
- ACF Pro with SlickJS [closed]
- Hide Tab Titles from Tabs Block
- Unable to use Datepicker in a table when inserting a row
- How would I add this code to a single WordPress page?
- Trouble with adding preloader to my home page index.html and index.js
- Import HTML code that loads css and javascript into specific page
- Interactive maps in wordpress
- How can I use Advanced Custom Field Option page in CSS WordPress
- Can I upload my HTML/CSS/Javascript game onto a WordPress page?
- How can I scroll to an element using jQuery?
- Remove CSS class from element with JavaScript (no jQuery) [duplicate]
- What is the meaning of == $0 that is shown in inspect element of google chrome for the selected element [duplicate]
- Bootstrap Dropdown menu is not working
- Make div scrollable
- Bootstrap Dropdown menu is not working
- Bootstrap Dropdown menu is not working
- right align an image using CSS HTML
- How to completely remove borders from HTML table
- Why “Inline-block” doesn’t work properly in this CSS?
- How to fix a footer overlapping content?
- What’s the HTML to have a horizontal space between two objects?
- HTML/CSS float: left; is not working properly
- Textarea Auto height
- How to get current screen width in CSS?
- CSS “margin: 0 auto” not centering
- margin-right is not working with my HTML. How can I center my content?
- how to center an inline div using css?
- Force div to be topmost element of any and all webpages
- How to place Text and an Image next to each other in HTML?
- Set bootstrap modal body height by percentage
- Failed to decode downloaded font
- Center HTML Input Text Field Placeholder
- how to display a div triggered by onclick event
- creating a chevron in CSS
- jQuery scrollTop() method not working
- JavaScript – Count Number of Visitor for Website
- How to make fixed header table inside scrollable div?
- How to get multiple images to auto resize and stay centered within a div
- Cannot read property ‘style’ of undefined — Uncaught Type Error
- How to make HTML element resizable using pure Javascript?
- How can I center
- into a div?
- How to align this span to the right of the div?
- How do I clear the content of a div using JavaScript?
- WordPress Admin Bar Overlapping Twitter Bootstrap Navigation [closed]
- How to solve ‘Eliminate render-blocking JavaScript and CSS in above-the-fold’ content for multiple files?
- Collapsible button inside a ul list does work in jsfiddle but not in WP
- Remove WordPress/Gutenberg button styles for ACF blocks
- Relative path instead of absolute for wp_enqueue_script
- Handling URLs in WordPress application
- Can “ and “ tags be used in the HTML editor?
- JavaScript added as link/stylesheet
- How can i add note, caution, warning quote inside the text? [closed]
- Eliminate render-blocking JavaScript and CSS in above-the-fold content
- how to setup content on a static frontpage with css and xhtml
- Implementing a simple slider in code?
- Google yolo one tab signup plugin avilable in wordpress? [closed]
- Disable File Editing function
- Adding a Calculator to a WordPress Page
- Get post format and use it as a CSS class in different spans
- HTML email sent with wp_mail shows plain text
- custom header navigation has odd spacing [closed]
- Conditionally enqueue a stylesheet based off of a javascript click event
- Custom CSS is not working?
- Link to page with posts of specific type
- how to stop the shaking effect on my homepage [closed]
- How to avoid repeating similar properties for all tds of a table in a wordpress post
- ACF Gut block broke wordpress default style?
- WordPress Rest Api access the header and extract stylesheets URL
- How to make a function to play only on the home page?
- Where to add this code for a Modal box to work? [closed]
- Overriding inline !important CSS with Javscript code snippet with media query
- Getting and setting CSS variables with JQuery in WordPress backend fails
- Getting click on item to open closest relevant element (popup) with jQuery
- how to modify html on homepage (no home-page.php in my theme)
- Hide CSS class only in single post pages
- current menu item hover not working?
- Page flickers when new html5 video loads
- Target a specific container to style on WordPress storefront theme
- Css style removed but still showing via CDN even after clearing browser cache and purging all caches for site
- Where to find the html for WordPress site? [closed]
- My contact form is not being responsive
- I cannot make this position properly in WordPress [closed]
- Pages in another language
- Possible jquery / library conflict in plugin usage
- Add HTML input tag to to site navigation
- What can cause JavaScript and CSS files to be minified?
- I need css code to divide my webpage sections into two columns
- How to add input search field with roudned corners?
- How do I add JS and CSS to WP (Flatsome)
- WordPress site suddenly not showing some DOM elements but mobile is fine
- Grid problem on privew mode
- Editing size of h3 tag in wordpress on a one-off basis
- Modal pop-up HTML code works on other sites or HTML viewers but not in the custom HTML block within a wordpress page?