According to docs (https://developer.wordpress.org/reference/functions/get_post_meta/), it should be something like:
<?php if(!get_post_meta(get_the_ID(), 'buy_status', true)): ?>
display: block;
<?php else: ?>
display: none;
<?php endif; ?>
Related Posts:
- How do I change/modify the_post_thumbnail(); html output?
- Why do templates contain so many PHP tag pairs?
- How do I use Shortcodes inside of HTML tags?
- Why would a GET variable one one page of a site cause a 404 error when a GET variable works on another page of a site?
- Where should I install a PHP library into WordPress so that code in a webpage can activate it?
- WordPress Shortcode and Dynamic CSS
- Correct way to make static pages editable in wordpress
- How do I edit the php/html for a particular post?
- Multiple pages on one with different HTML
- Is it ok to replace php code with html?
- Add custom HTML to posts page
- Minify HTML, CSS, JS with PHPWee?
- Placing raw HTML inside a WordPress shortcode
- How to only show page id as body class?
- Shortcode content output but not in correct place
- An unwanted inline style is added to my body tag
- Show post in slider
- HTML tags in bloginfo description
- Add a class to the anchor tag on HTML5 gallery
- Transferring working local PHP site to wordpress – with database (MySQL)
- how to remove metadata from the posts of my blog?
- Where in PHP do I move title and meta (date) to bottom of each blog section?
- Using the echo command adds unwanted br tags to source
- How to store data from multiple forms using ajax and php
- Use DOMDocument with ob_start breaks my HTML code
- selected option if current category is the value
- Input data from email form not going to JSON file
- Different post styles depending on category
- How do I remove the product thumbnail link from a specific div in Woocommerce? [closed]
- Commenting out unwated CSS/scripts in HTML with PHP
- Make PHP work with HTML tags
- Is this spyware on my site or a real Java update?
- Syntax error when I try to insert my loop into an unordered list? [closed]
- Search WordPress using static html page
- Function returns text instead of html [closed]
- Printing HTML codes
- How i can get post data from database when i am getting post id from url in wordpress
- WordPress plug-in for dynamic download link?
- How to remove the h6 tag for the entry-category Class
- Override user-edit.php to design own profile page
- Where can I find the inline-css of my theme header?
- Make textarea required. Help [closed]
- Menu Custom Data Attributes
- Highlight the links without using dropdown
- How to turn each phone number within the $content to a telephone link?
- Creating custom page template from existing PHP site
- wordpress site – using custom database and PHP
- Website completely messes up when logging out
- Calling PHP Titles inside Javascript Markup
- How can I use custom menus with a Bootstrap WordPress theme?
- Replacing WordPress Icons (menu,icons32, etc)?
- Custom forms with HTML
- how to changes mobile menu toggle breakpoint in WordPress
- PHP inside echo HTML
- html form: redirect page after form completes submit function and posts data
- HTML Form Question
- WordPress Post Block Element not properly parsed with the_content filter
- Hide A Class and Add Custom HTML Code Using WordPress
- Add other class content with reference class value
- What are the advantages/disadvantages of ways to use php template files?
- Configure WordPress to Use Responsive Image Rendering
- How to use data URL in WordPress?
- HTML comment cause issue in functions.php script root
- Slug duplicates once clicking on link
- Remove span tags from WooCommerce Downloads page
- How to enable HTML tags in category description without breaking the category page
- Can’t display anything through homepage text editor
- How to find and delete a menu item in php?
- My single.php page skips the first div tag
- Custom woocommerce payment gateway – Form
- opens like sitename.com/URL
- WordPress Slider is not working
- How to display post meta bellow every posts
- Make a full-width wordpress page
- Display child-page links in sidebar on both Parent Pages AND Child Pages
- Switch position of elements in the footer [closed]
- Add Text Area To Child Theme’s Home Page
- Can’t get_users info by using json_encode
- scroll scrpit to particular button position to next id when click button
- Code works on page-example.php by not category-example.php
- how to remove replicating a tag inside loop?
- Add Alt attribute to image served with php
- How to add thumbnails from recent posts to owl-carousel in wordpress automatically?
- Add options to WordPress backend
- WordPress HTML Helper
- Automatically create a loop for post ID
- echo variable containing html and the_permalink();
- Trying to customize wordpress drop down categories
- get_post_meta is always empty when I use wp_mail
- Save Option on Database
- Parse error: syntax error, unexpected ‘echo’ (T_ECHO) in C:\xampp\htdocs\AttendanceSystem\resources\php\method.php on line 250 [closed]
- Implement “No related posts for this entry” into the loop?
- ACF repeater image in video poster with jquery
- Load Meta box value into div AJAX [duplicate]
- How make wp_nav() with my css?
- Advanced Custom Fields Show PHP in Text Areas
- Sorting Problem
- Is there a better way to output HTML as a shortcode?
- Remove post image caption from post_excerpt();
- How can I change text on my SearchWP search results page, as this is not an editable page in WordPress?