Apparently you are simply not translating your logic into code:
- if it has shortcode, do this,
- if not has shortcode but has thumbnail, do that,
- otherwise, do something else.
if ( wpsite_has_topwide_shortcode() ) {
echo 'shortcode';
} elseif( has_post_thumbnail() ) {
echo get_the_post_thumbnail( $post->ID, 'full' );
} else {
echo 'Hello World';
}
Related Posts:
- Changing playlist shortcode thumbnail sizes?
- Shortcode does not work, changes html order
- Get a post’s thumbnail url or display default image in shortcode
- Custom recent-posts shortcode’s thumbnail image not in line with rest of code
- Is there any way to set the Featured image in wordpress post editor, using a Getty images embed code
- Featured image with link to post shortcode, image displaying above the post
- Using wp_editor in shortcode
- Why are you using add_action for shortcode?
- How to get URL param to shortcode?
- Featured image shortcode
- Making a Shortcode [NEXT] and [PREVIOUS] to place into specific posts for post navigation
- Native “playlist” shortcode random playing… How?
- How to display the names of users from a specific group with a shortcode?
- shortcode for logo image
- Stop strip_shortcodes() stripping content inside shortcodes
- Get multiple shortcode attribute values
- How do i link gallery thumbnails to different url’s using the wp native gallery?
- How to display some selected user meta data on a specific page with a shortcode?
- Gallery shortcode menu order fix no longer working on WordPress 4.0
- How to save a shortcode in a Gutenberg custom block?
- Is shortcode_unautop() broken?
- Shortcode displays only default attribute values
- Can a shortcode function this way
- Dynamically create shortcodes using add_shortcode and a callback
- Passing attributes to shortcode dynamically
- Stop parsing shortcodes
- Meta tags in shortcode
- Gist shortcode is not working
- Display post metadata: “title, category, author, date” with shortcode
- shortcode javascript not working on custom template file inside theme folder
- shortcode get thumbnail size
- Compatibility of MathJax extension and JetPack [closed]
- Any Short code Availble for Get Post List With Thumbnail Plugin?
- MathJax inside shortcode
- How to add class or id to shortcode HTML elements?
- Change WordPress Shortcode added in to post
- Changing the title tag from a shortcode
- WordPress wpautop/shortcode generating invalid markup
- Detecting embeded video format
- While loop shortcode problem
- Remove ‘p’ tags around shortcodes and ‘img’
- How to prevent shortcode preview from breaking in tinymce editor?
- Execute Closing Shortcode After the_content
- Forcing max-width for image captions
- WordPress Short code with additional parameter
- Creating a short code with php inside
- Is it possible to modify the header with a content shortcode?
- PHP/WordPress — How do I check if Shortcode returns content?
- Custom shortcode breaks my page
- Custom shortcode is causing a WSOD
- this simple shortcode doesn’t generate Collapse as supposed
- Shortcode outputting at top of content
- Will a shortcode placed inside a paragraph tag still be valid?
- Shortcode Strategy
- Enclosing Shortcode is acting like self-closing
- How to create a shortcode to let the user add the ID of a YouTube video?
- How do I define and register a shortcode function in a namespaced functions.php file?
- Change user meta value with shortcode
- How to add shortcode to html widget
- Implementing a URL Shortener
- WordPress User ID as Shortcode
- Add div on EMED Tag
- Clean way of using ob_start() and ob_end_clean() in wordpress
- Theme Convert PHP code to shortcode
- find shortcode inside content of post
- WordPress Short code for List style
- Processing a login/register form before shortcodes are rendered?
- Adding a cover image to video shortcode
- Insert First Image into post (full-width)
- How can i strip shortcode from HTML title tag?
- Show content if user left comment / non-logged visitors?
- How to insert current user ID/entry ID into a shortcode?
- Need help with creating a simple shortcode
- Using a WP shortcode in Homepage
- i want to show a modal when user lands on home page very first time
- Gutenberg running code only available in front end within shortcode
- create shortcode that changes url endpoint
- Logout user if click on a custom page link
- Shortcode Attribute not defined
- Second attribute of shortcode is not changing why?
- Removing text + shortcode from all posts
- Is Post-Author-Id shortocde
- Load next post by ID on a single page
- Add catagory attribute to custom shortcode
- Class variables in shortcodes
- Separating Custom Template logic
- Defining the output of a WordPress Att
- Remove width and height attributes from [gallery] output
- Custom WP theme not showing shortcodes
- Shortcode for sectors
- How to not show shortcode contents if cart is empty?
- Help with Shortcode Functionality
- Shortcode Site include in a other
- Shortcode with foreach
- How do write this type shortcode? [closed]
- WordPress functions.php shortcode is not working [closed]
- My first WordPress shortcode just returning []
- I have the query code but not the shortcode
- wordpress how to sort posts on custom data with plug-in “Search & Filter”
- How to reuse php templates as shortcodes?