Yes it is possible. I believe it is better if you put it in a conditional statement
- Check for featured image easy;
- Check for attached file with an image mime type using this and this;
- Check for any
<img>
tag in the post content (detail); - If there is no image at all, then use a default image
Hope this help
Related Posts:
- initial sort order for a sortable custom column in admin
- Gallery Settings Change available Columns
- Can you have the users list pre sorted by specific column?
- How to remove Gravatar from Username column
- how to display “Edit | Quick Edit | Trash | View” in custom WP_List_Table column?
- Manage users custom column add class “num”
- Are there any filters to add additional columns to the list table on edit-comments.php?
- Admin multiple column sorting
- Add last Revision of Post column on Admin Panel
- How to add custom classes to admin list table default rows or columns?
- Attachment display settings only allows “full-size”
- Get post attached image to display in admin dashboard
- Excerpt showing under title in admin columns
- Set Link Target Checkbox chcked on Edit Image MOdal Window in Admin Post Edit Screen?
- Sortable admin columns by 0.00 number
- Add button in admin columns
- What are the standard admin CSS id/class tags?
- how to know if admin is in edit page or post [duplicate]
- The website cannot display the page
- Set Default Admin Colour For All Users
- Settings API – easiest way of validating checkboxes?
- Uploading files in admin panel?
- Redirect Admin User in Dashboard
- Read only capability for custom post in admin area
- How can ‘admin_email’ be set?
- How to change WordPress default strings?
- Remove ability to access certain admin menus
- Gutenberg “Add Block” button is not active (greyed out), cannot add new blocks
- How To View Site from Non-Logged-In User’s Perspective
- Conditional check for front-end which includes ajax
- Hide update messages from non-admin users?
- Daily notices of failed login attempts for non-existent admin user
- Custom admin columns for ALL custom post types
- Adding an email column to a Custom Post Types Admin Screen?
- Wrong url in sortable column headers & pagination in the admin, when behind a proxy
- “Automatically add new top-level pages” Default
- Get email address of type Administrator
- Check if user is logged in else login page
- How to show custom (checkbox) field value in admin post list?
- How to add a column to the Trash page?
- Add tabbed menu to admin page
- Is there a way to have admins that are logged in to wordpress not have to enter the password for password protected pages while browsing the website?
- WYSIWYG – Getting the “link” button from HTML mode in Visual mode
- How to receive security update notification email?
- Include admins in author drop-down on edit post screen
- How can I restore admin capabilities?
- How to restrict wp-admin and prevent upload errors
- Adding another “Add Post” button to admin
- How to determine if an admin is logged in outside the loop
- What determines whether admin toolbar is shown to a logged-in user?
- Adding text in more than one language (at the same time)
- How to get view count of every page on site and add that (increasing) number to Dashboard Widget
- Restrict function call to page load but not ajax call
- How do I remove All and Published if not admin?
- How to disable https from wordpress site?
- Fatal error: Exception thrown without a stack frame in Unknown on line 0
- Apply permissions per post
- Settings API not saving values to database
- Dashboard menu missing
- Unable to upload image using the standard uploader in the WP admin (v4.3)
- Admin role not really admin
- Fixed layout for admin section
- How do I correctly transfer my site from one domain to another?
- Unable to get to the admin panel
- Where can I store common cross-site text (e.g. headings, titles etc.)
- How to find a spam link?
- How to change all “Post” texts in dahboard into “Article”?
- How to modify admin headers
- Filter WooCommerce Orders
- Directly editing content on webpage, is it possible?
- How to disable Media Library uploads for non-Admin users?
- Page can’t hand request – HTTP ERROR 500 – when updating something
- Admin user lacks admin permissions after hack and can’t reinstate
- How to change the User name and Password of admin account
- Redirect public site to another one but allow administrators to access the old site
- “sufficient permissions” error for admin after duplicating WP database to new install
- Posts in sidebar only by admin
- Display an image of selected template in admin to aid user when using complex templates
- Passing state from child component to parent component in a Gutenberg Sidebar
- I can’t enter the control panel of my wordpress site after channing the URL to https://
- Admin user column sort by numeric meta key
- Can I retrieve Published changes when changes have been Saved but not Published in WordPress Semplice?
- Error 404 Display on otherlinks apart from homepage
- Get Link of Page Selected through a Select Field in Custom Admin Page
- How to change the title attribute for the WP logo image on wp-login.php
- conditionally update css on edit.php
- Simple CSS admin pagination
- Can I show the tag admin interface on a post when logged in as an admin?
- WordPress “Hide WP” Gives Me Error After Admin Login [closed]
- site admin for subscribers
- WordPress gallery image link gives 404 when not logged in
- Custom Div with links on Admin Bar
- WordPress admin loads erratically “connection reset by peer”
- Remove “minor-publishing” div from Publish admin metabox
- How to fix broken admin Thickbox?
- New User Notification – Setting Email
- AllowOveride All causes assetts and Admin Urls to 404
- Can’t access my wp admin: captcha images invisible, gives me error message
- You do not have permission to access this document on form submit
- Woo Commerce Settings for Check-out Form [closed]