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 can I fetch loop of post titles via AJAX?
- Inject post (from specific category) between posts in Loop
- get product attributes for current product and store it in a variable
- Metabox repeating fields – radio buttons not saving correctly
- add_meta_boxes action with refresh on save
- Installing wp3.2.1 on IIS; getting empty sessions
- Want to separate sections of posts. Can you restart loop?
- Specific Loop For 2 Within Each
- Two posts in same div – WP loop
- Infinite-Scroll Plugin and Jetpack Infinite Scroll Plugin – Adding to “Thoughts” Theme
- Woocommerce, recognize the loop of related products
- Easiest way to show total number of subpages
- Custom Loop through category menu to include sub categories
- Output 2 items within the Loop
- Custom excerpt function re-factoring
- How can I show the post thumbnail from the most recent of a certain post type, in widget?
- How can I add pagination and how can I change thumbnail size?
- ACF page while loop breaks footer while loop
- Split loop into two columns, how to favor one side over the other
- How to Arrange PHP Files to Allow for Multiple Types of Pages?
- 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?
- Filter Select results based on selection
- Show css depending on activity type in BuddyPress activity-loop [closed]
- Need Help Fixing My Iframes [closed]
- Increase offset while looping
- remove post that has no content
- Checking array against author id in loop
- How do I Turn This Into An if statement?
- can i fetch a custom metabox data in another page or post type?
- Widgets in the loop if active
- Get post id within comments loop
- Syntax error when I try to insert my loop into an unordered list? [closed]
- Find a way to retrive data updated through metabox plugin to web page
- How to get post ID in a Page?
- PHP Warning: strip_tags() expects parameter 1 to be string?
- Echo a shortcode div after every 3 posts
- How to overwrite orderby with add_query_var
- meta box not display data input in the textarea
- Add class to DIV depending on page loaded
- get_the_ID() in the footer returns wrong value
- Show ACF field with link to ultimate member profile/WordPress user profile below the post (single post layout)
- Only show first image in foreach loop
- How to get current post category details inside “loop”?
- How to pass current loop data into nested loop
- Add editor toolbar to Metabox
- WP_Query multiple post results
- Convert Featured products loop into Recent products loop?
- Wpdb get->results to out the the month from the db
- Infinite Loop – WP_Query
- Limit tags shown in post
- Create Div Wrapper On 3rd Iteration Or When Query Loop Items Run Out
- Conditionally remove comments and post meta in functions.php
- How to create Loop code for Menu using WordPress?
- Add class to every other posts using get_posts
- Display metabox title for custom fields with values
- Wp Query : Order by distance lat,lon
- Checkbox doesn’t save inside metabox
- How to Add a cutsom slug to my custom author role
- Give ID to divs inside the loop
- Display articles with a different template in the home page | Solved |
- How to output the taxonomies that are assigned to each custom post?
- Conditional formatting on data fetched from MYSQL
- Looping through dummy posts and showing them in the main index.php
- Custom Loop.php having a loop inside a loop
- ACF – Get ID of relationship field in flexible content
- How to output values from a loop into a javascript array
- WordPress Ajax filter: Create two loops for different output styles?
- How to display sticky post always at the top (before regular post) in wordpress?
- Return to the beginning of the results of a for loop
- How to count posts posts if they are in a separate content page?
- Exclude category and post from loop in custom category.php
- Meta Box clears saved field content
- Thumbnail wouldn’t scale to size properly
- How to sort (orderby) a query done by a template function before the ‘foreach’ loop?
- Making list of posts with chosen description
- Metabox – Displaying the Value of a Metabox
- what’s the syntax for if the image exists get the image?
- Add div after every 4 posts then every 2 posts for a responsive loop
- how to remove replicating a tag inside loop?
- My query keeps looping infinitely ! how to stop it?
- Custom Taxonomy Link Text Echo Name Not Slug
- custom field meta-box with dropdown/autocomplete
- Repeatable field within repeatable group of fields
- Problems With Query and/or Template Part and/or PHP
- Two loops in one function
- Error trying import one category on page
- the_post_thumbnail unless video id is added
- How to callback custom field text
- How to call the_author_meta and make it work?
- Display custom meta box in my template file
- WordPress post pagination on custom template not working
- Implement “No related posts for this entry” into the loop?
- send meta box input data without publish button
- Excerpt all post content Content Same Size without word cutting off
- Options.php loop won’t show!
- Warning: Illegal string offset ‘post’ and ‘page’
- How to get meta box labels?
- How do I exclude the current post from the upcoming post query