You can try this:
<?php
// get image source:
$metaboxtext3 = esc_attr( get_post_meta( get_the_ID(), 'my_meta_box_text3', true ) );
// get link:
$metaboxtext4 = esc_attr( get_post_meta( get_the_ID(), 'my_meta_box_text4', true ) );
// check if the image source exists:
if(strlen($metaboxtext3)>0){ ?>
<a href="https://wordpress.stackexchange.com/questions/84788/<?php echo $metaboxtext4; ?>"><img src="<?php echo $metaboxtext3; ?>" alt="" onerror="this.style.display='none'"/></a>
<?php } ?>
Related Posts:
- Loop with slider (slider not loading)
- How to get URL of current page displayed?
- Getting only direct child pages in WordPress with get_pages
- Query multiple custom post types in single loop
- What is This esc_html_e() i wordpress php?
- How can I fetch loop of post titles via AJAX?
- Inject post (from specific category) between posts in Loop
- Knowing the total number of posts before to get into the loop
- get product attributes for current product and store it in a variable
- Metabox repeating fields – radio buttons not saving correctly
- Build a content and excerpt grid loop with paging and options for # of posts
- How to remove a metabox from menu editor page?
- Why is my custom meta box input not saving
- Displaying post per day
- add_meta_boxes action with refresh on save
- Installing wp3.2.1 on IIS; getting empty sessions
- Guidance with The Loop for CMS
- Save selected item from dropdown menu in a meta box as a metadata value for a custom post type
- Display only text to WordPress loop without loosing the text formatting
- How to loop over custom fields in a page template?
- Conditional Statement – check if post has an attachment image
- How to add active class to custom menu using while loop and wp_list_pages
- Want to separate sections of posts. Can you restart loop?
- MySQL query performed 4 times inside loop
- Print html when custom field has value inside while loop
- Second select list values are not saved after clicking update
- Alter secondary loop to exclude posts from current page category
- Post from one loop in different containers?
- Custom Loop Pagination on WordPress
- Specific Loop For 2 Within Each
- Saving metabox repeatable fields
- delete an array element when its date expires
- Two posts in same div – WP loop
- Infinite-Scroll Plugin and Jetpack Infinite Scroll Plugin – Adding to “Thoughts” Theme
- How to change post count in wordpress loop?
- How can I loop into two different DIVS without repeating the DIVs
- User Defined order on get_categories?
- Woocommerce, recognize the loop of related products
- Trying to use Ternary operators with WP Conditionals
- Store loop into array
- Looping through WP_Post Object
- WordPress loop specific thumbnail size
- get understrap pagination to work with custom query
- Woocommerce – How to get products which have a sale between 20% to 40%? [closed]
- Displaying Only Certain Tags in Loop
- Easiest way to show total number of subpages
- How to do conditional publishing?
- Custom Loop through category menu to include sub categories
- When would you use $_post instead of $post?
- Output 2 items within the Loop
- How do I display the function the_content in this loop?
- Show Custom Taxonomy Title
- conditional statement for custom taxonomy
- How to exclude specific category from the get_the_category(); array
- Way to display “Yesterday”, “Today”
- How can i display post loop in table format?
- spliting posts into two columns
- Must Use Plugin Causing Query Error
- How to get to a specific position in wp_query?
- Advanced Custom Fields: Post Object – Not returning data [closed]
- How to speed up a wordpress function with multiple loops?
- wp_editor and WPAlchemy messes up tags when updating
- Facebook “like” open graph meta in header.php
- Custom excerpt function re-factoring
- How can I show the post thumbnail from the most recent of a certain post type, in widget?
- Register non hierarchical taxonomy and the show meta box in the post type
- multiple if statements [closed]
- How to select WooCommerce products by post_meta and order them
- How can I add pagination and how can I change thumbnail size?
- How to Display a Single Post Excerpt
- have_posts() execution failure
- Customize Plugin
- Add user settings to specific roles
- How to display conditional-content if wp_nav_menu( $args ) retruns something
- How does the ternary operator work in the wordpress loop post?
- $wpdb->flush(); breaks the loop
- Create a new usermeta field for users
- Use object in template part
- Get first URL from post content
- How can I add multiple ‘tax_query’ arrays via a loop?
- ACF page while loop breaks footer while loop
- Redirect to a different page through registration, depending on page
- Using foreach loop breaks
- Cannot display or echo alt text on featured image
- Using Advanced Custom Fields to create a per page slider
- Split loop into two columns, how to favor one side over the other
- WordPress Search Results for Multiple Post Types
- How to select the contents in the text view textrea in wp_editor?
- Changing layout with wp_customise
- How to Arrange PHP Files to Allow for Multiple Types of Pages?
- What is the correct way to write this conditional statement?
- Dynamic Stylesheet loads but doesn’t finish
- Can I prevent the user from adding more than two levels deep of terms inside of a taxonomy metabox?
- Image media upload metabox
- Filter Select results based on selection
- Using loop pagination on single.php
- Reordering Buddy Press profile navigation [closed]
- How to hide all child pages with post_query?
- How to sort posts based on the value (number) of a post’s metadata?
- Linking text within textarea of custom meta box