First, you have a typo in the provided code: an extra space between the apostrophe and the forward slash before “white-placeholder.”
Second, without examining the underlying logic in detail, I might try for the else statement:
else {
$placeholder_image = get_stylesheet_directory_uri() . '/white-placeholder-200x100.png';
return $placeholder_image;
}
Related Posts:
- How do I change/modify the_post_thumbnail(); html output?
- How to make thumbnail image fit into a div where image dimentions are completely different?
- How to Display Image Meta underneath EVERY image in EVERY post
- Set the background to a default image if there isn’t a specified “featured image”
- height should be set to auto to avoid pixelation in the post thumbnail function
- Else/If Statement to Display Photo Descriptions
- Get the alt text of the image in a array
- Add Featured Image to Existing Post
- not outputting medium size image URL
- How to put 2 php codes in functions.php without site crashing
- How to link all featured images to custom url in single.php for only non-logged-in users?
- insert thumbnail image from php script
- Can’t put a hyperlink on Featured Post’s Image
- Overwriting a Shortcode
- add if statement to the featured image
- Remove default Image Sizes
- Add attribute to featured image with filter (wp_get_attachment_image_attributes)
- Generate and upload screenshot as featured image for user-submitted post
- Remove “Insert from URL” link in Media upload – WP 3.5
- Proper use of Output Buffer
- Adding Featured Image to Post programatically
- Count Title and Post Characters
- How to remove this function from the homepage?
- Check if current page is wp-admin
- HTML table from shortcode with multiple parameters
- Nested shortCode functions in the functions.php file
- Show only IF not Google bot [closed]
- How the functions in WP are called in tags
- Woocommerce – remove product from category
- Differences when using the the_time and the_date functions
- 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
- Is it possible to use Data URI image to set a post thumbnail?
- 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
- 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?
- 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?
- List post by title length
- Class property seems to lose scope, attached to save_post action?
- Nav-Menu not showing up
- Show different website layout if no sidebar added
- WordPress theme showing blank page
- get_template_part function and add images
- Need advice on theme customizer and child themes
- How to make sure relative URL works when site is not on root domain?
- How to pass hook variable to function?
- exclude custom post type from running a function
- Migrating site, only header shows
- The additional fee for the COD payment method not visible in the front-end
- PHP identify duplicate words in a text string against a list of words
- How to access all meta data for RSS feed?
- Why Is Number of views on wordpress single post wrong?
- Change Language Title Pagination on Subdomain non Multisite
- remove specificly the last tag in all posts
- How to use Page link field with is_page()
- How to hide a child category and show his parent category
- How to add and subtract user meta values after post meta update
- Multiple AJAX handler functions conflict in functions.php
- add another variable to php function
- How to remove get_header From all single pages in wordpress with functions.php without plugin?
- wp_query – Exclude the first thumbnail from lazy loading on archives
- Gutenberg block don’t save rich text content
- 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?
- 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
- str_replace not preserving whitespace
- 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
- How to correctly add the featured immage (thumbnails) support in a WP theme? Why I can’t add a featured immage?
- Calling the Next category link on an archive page – WordPress
- Metabox Input Not saving
- 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
- 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 Navigation Bar JSON Syntax Error in JSON at Position 0
- How to extract URLs from wordpress taxonomies
- How call WordPress shortcode inside function file
- strict custom php script on specific product category [closed]
- Add adjacent post function inside custom recent post function