You can use empty, to check your variable.
Something like this
$prod_id = get_the_ID();
if (!empty(get_post_meta($prod_id,'_product_tech',true))) {
echo'<a class="shutter" title="technische gegevens" href="'.get_post_meta($prod_id,'_product_tech',true).'"><img width="750" height="100%" src="'.get_post_meta($prod_id,'_product_tech',true).'"></a>';
} else {
//Is empty
}
Related Posts:
- Remove “Insert from URL” link in Media upload – WP 3.5
- Proper use of Output Buffer
- Should I write a PHP function in home.php?
- Edit tag cloud widget number
- function_exists call in function.php
- How to log out everywhere else, destroy all sessions “all other devices”?
- the_post_thumbnail() based on the Post ID
- Allow authors to post only in categories they create in WordPress
- Hide a menu-item and its submenus and display a ‘Log in’ link if the user is logged out
- Count Title and Post Characters
- How to remove this function from the homepage?
- Logout and redirect using the WP Menu
- Check if current page is wp-admin
- HTML table from shortcode with multiple parameters
- Insert all post IDs in new database table
- Nested shortCode functions in the functions.php file
- Show only IF not Google bot [closed]
- How the functions in WP are called in tags
- How to speed up admin-ajax.php in wordpress
- My Own layout in WooCommerce pages [closed]
- Woocommerce – remove product from category
- Differences when using the the_time and the_date functions
- How do I publish only one page to production after making changes on staging?
- get current product name in functions.php
- Displaying the Month and Year that a page was Created?
- How to style options page in dashboard?
- How to access global variable $menu inside a class function
- Why ajax doesn’t work on certain wordpress hooks?
- Print last modified date only on posts
- WooCommerce: How can I get orders with a custom ID in order meta data object?
- Modify function to print tags/categories/exclude tags/categories/ number of posts
- Search not showing all results
- How to Reference/Echo Variable from Another PHP Function
- Security for data obtained from the database
- Make Current/Active Page Number a Link (WP_LINK_PAGES)
- How to make modifications only to certain elements of an HTML string on the server-side?
- How do I modify the custom footer text and get theme version number to show in wordpress admin?
- How to use html inside a functions.php code?
- Nested “do” and “add” Actions is possible?
- Custom Pagination is Broken
- Sidebar not appearing in footer, but it appears everywhere else!
- linking stylesheets and scripts with functions.php
- How can I hook into the wp_mail function used by BackWPup?
- Why i can’t get custom fields value or post ID via Ajax?
- List post by title length
- Fallback image URL if no featured image exists via a shortcode function
- how to enqueque code in a php file from functions.php
- Only load certain artists on this page
- Deactivate a plugin on wp version
- the_post_thumbnail issues
- Some problems calling a function into sprintf() inside functions.php template file [closed]
- Convert all uploaded PNG files to PNG-8 format
- Uses for function: wp_update_user
- WP insert post Redirect after function has executed
- How to Redirect Buddypress Directories To Login Page For Non Logged in Users
- Woocommerce order status payment
- How to define a rule in functions.php that ONLY disables the default wp functionality that undesirably changes ‘&’ to ‘#038;’?
- Uncaught TypeError: extract(): Argument #1 ($array) must be of type array, null given
- Display logged in user name and lastname on page
- How to Add a cutsom slug to my custom author role
- Gutenberg block don’t save rich text content
- ssl redirect function is not working
- Hide specific shipping methode depending on day and time of day
- Adding custom field to product category and show it to shop/category shop page
- Change lost password url to a mailto URL in WordPress
- How to change this ajax function to submit to the default wordpress content area instead of the custom field ‘seller notes’?
- Remove span tags from WooCommerce Downloads page
- Send POST request to Flask app from functions.php file
- 500 Error, Get custom field and returning it
- How to add typehints to function in functions.php when argument is an object?
- How to auto-generate random numbers in username?
- Remove generated category and tag class names from woocommerce product & blog listings markup
- is_user_logged_in() not working in homepage
- Custom Post type Ajax search results
- How to add a custom class for iframe by embed_oembed_html
- remove public static function wp_link_dialog()
- Find the method which AJAX GET calls
- str_replace not preserving whitespace
- How can I display a query in a page?
- Calling PHP function doesn’t work in index.php
- How to set up an auto delete post?
- Display a post based on its metabox selection
- Calling the Next category link on an archive page – WordPress
- Metabox Input Not saving
- Password form redirection to belonging post
- Trouble using wordpress functions in a pop-up modal form
- admin-ajax.php loading many times
- Cross origin ajax request always returns 0 when calling get_current_user_id();
- echo php values in table – strange behaviour, not all values are shown
- Merging two excerpt functions to work with conditions
- wp wp_register_script function results type parameter missing
- Whats wrong with my code? Need To add String to shortcode? [closed]
- how can I make content from a plugin hidden when user is logged in? [duplicate]
- How to insert the first letter in uppercase [closed]
- Custom WordPress Function – Adding items from Foreach Loop into an array and Updating Field based on array of IDs (ACF + WooCommerce)
- Create custom API endpoint to change custom header image
- Can I associate a custom post type with another custom post type?
- Creating posts with php-script + csv
- Change WooCommerce Order status from frontend form submitted data
- Show Login Errors In WordPress/Elementor (Code “works”, but breaks site)