Try $HTML
instead of $html
Linux based systems are case-sensitive …
function post_banner_shortcode($atts) {
$atts = shortcode_atts( array(
'id' => ''
), $atts );
$post_id = $atts['id'];
$HTML = '<div class="postbanner">';
$HTML .= '<div class="pb-thumb">' . get_the_post_thumbnail($post_id, 'medium') . '</div>';
$HTML .= '<div class="pb-ttl-txt">';
$HTML .= '<h4>' . get_the_title($post_id) . '</h4>';
$HTML .= '<p>' . get_the_excerpt($post_id) . '</p>';
$HTML .= '</div>';
$HTML .= '</div>';
return $HTML;
}
add_shortcode( 'postbanner', 'post_banner_shortcode' );
Related Posts:
- Stop WordPress automatically adding tags to post content
- WordPress removing tags?
- Update all posts automatically when using post_meta
- Search & Remove Specific Shortcode From All Posts
- Shortcode Not displayed at the Right Place [duplicate]
- Automatically added brs and paragraphs?
- Specific loop in Shortcode
- How to add shortcode tags in single.php [closed]
- How To Add Perfect Apostrophe And Quotation Mark In WordPress Posts?
- Adding variable for post title so post template can include auto-generated link to view on external website.com/{post title}
- How to create shortcode to show the 2 latest posts
- Hide Post comments when displayed via WP_Query
- Remove Shortcode […] from Blog Preview
- UberMenu list current user’s posts as menu items
- Duplicating Table of Contents for Paginated Post
- Query how many items to show in shortcode
- do_shortcode within post query
- How to get rid of shortcodes in post content once and for all
- get_the_content(“more…”) returns full text
- Is there a straight-forward way to iterate over all shortcodes in a post?
- How can i display gallery shortcode output under Post text
- How to display Common posts from specific Tag & Category with Shortcode
- What’s the best way to render Visual Composer in posts, not pages?
- display-posts shortcode attributes have no effect
- Shortcode and whitespace formatting problem
- Shortcode to display the latest news article within a page
- Shortcodes on my website stops working after theme update [closed]
- How to get ID of the page included with get_page()?
- How to get a post’s details by shortcode?
- Shortcode with ‘year’ parameter
- How come a YouTube link isn’t transformed into a shortcode inside the post content?
- Is it possible to add a shortcode below post title?
- WordPress 302 Redirect to Random Product/Post/Page
- How to convert query sql to shortcode in wordpress?
- How can I add 2 buttons with shortcode
- Why aren’t paragraphs breaking on this page?
- HTML Inside of Shortcode Breaks Shortcode Output
- Shortcode for tables which can include comma and linebreaks
- post/page content
- Change published date and time using SQL query for page in every 5 hour
- What parameters do I need to pass to get_tags to get ALL tags for the site, when used in a post
- Shortcode for Comments and Comment Boxes in Post Loop
- get category in list of posts // shortcode for custom related posts
- shortcode // get posts by ids
- Display “no post” message
- How can I create a shortcode to show the number of posts of actual day?
- Featured Story Shortcode not outputting content
- Function is printing twice – any suggestions?
- How to pull sticky post permalink inside php?
- Contact Form 7 Shortcode not recognized inside another shortcode
- Display Post from Custom Post Type with Shortcode
- wp_insert_post() Add and specific ID to the body of that
- Add a url parameter to the current post and read it in a shortcode
- Secretly passing post ID/title etc into a shortcode form automatically to link submission to post
- I need show posts by customer (Shortcode)
- Is it possible to query a category with specified posts?
- Shortcode: How to add custom posts?
- Add category attribute to custom recent post shortcode
- Shortcode for printing post titles
- How to use extract shortcode in loop?
- Using Post ID and Page ID in same function
- Display only posts with comments
- Change the default video URL in a post to shortcode format
- How do I add an article to specific page?
- get value from post to sidebar
- WordPress Yoast SEO plugin Post Save/Update Issue
- If post has non-shortcode string
- Insert Shortcode exactly at the end of the content
- Trying to create shortcode listing custom posts, but formating not being included
- Simple shortcode to check if a user has commented on a certain post
- Undefined Function Fatal Error with Shortcode [closed]
- How to use shortcode to get the second to newest post?
- How to add category to: ‘wp-admin/post-new.php’?
- How to publish a post with empty title and empty content?
- Change the Slug of Post Type post to baseurl/post/%postname%
- How to after saving or publishing a post redirect back to the original page
- Get user’s most published categories
- setup_postdata doesn`t seem ot be working
- Save re-arranged draggable post items to wordpress database
- Suddenly my last posts disappeared
- WordPress Multisite – Create Default Post and New Category On New Site Install
- Query Posts by Custom Field
- Format latest/newest post differently
- Loop doesn’t exclude the specified category in home page
- When moving a WordPress installation to a new server, why do I have to update each post before content shows?
- Change Author Name to Sitename on Frontend
- Inserting Media to WordPress Posts
- Problem with trying to display subheader in posts
- Custom Post Type, post-formats associated to custom post type > 404 archives
- Change content off every sixth element
- Custom post type and taxonomy page templates
- What would causes search to return incorrect results?
- Pagination not give another posts
- Can’t find webpage on All Pages or All Post menus
- Display Specific Categories posts on the home page
- Code to display random ordered posts in Categories across pages [duplicate]
- Modify loop to include all post statuses not just ‘published’
- How to convert return type of ‘get_posts()’ same as ‘wp_get_recent_posts()’?
- Auto selection of category based on subject line or TAG
- Single post pagination