Try to replace
'post__in' => array($instance['postsToShow']),
with
'post__in' => explode(",", $instance['postsToShow']),
to feed the post__in
with an array.
Your current array looks like
array("123,456,789")
but should be like
array("123", "456", "789")
Related Posts:
- Post-ID in url differs from $post->ID
- Posts on Sidebar only
- How to display most popular posts from certain category in sidebar?
- Get page ID of page that is set as the posts page
- How to get post ID of the current page/post inside a widget?
- Are post ID’s reliable?
- get all posts ID from a category
- Display Random Author with Details in Sidebar
- Get the current post ID as a variable in Javascript
- Is post ID number always incremental n+
- $post>ID displays wrong post ID
- widget should display post archive by year and on click also by month
- Post X of Y in single.php / sidebar.php
- $post->ID displays wrong ID
- At my posts archive page, outside the loop, get_the_id() returns the top most post’s ID
- Which file displays the date archive?
- Showing random content / pictures from earlier posts in a sticky post?
- Get the post_id of a new post
- Get all posts by post_author
- Display all posts under child sub category in sidebar on post page?
- How can I display a specific user’s first published post?
- Load posts into sidebar and paginate via ajax?
- How to show post(excerpt) from specific category on wp page?
- How to show video from specific category on sidebar?
- WordPress menu that shows all posts in a certain category like w3schools
- How can I hide the sidebar from a specific post?
- Displaying a widget only on long posts (over X characters)
- Can a page_id and a post_id be same?
- How can I display widget in a Page or Post?
- Getting current post ID in functions.php
- Buddypress activity id
- Show all posts in sidebar in single.php
- Get latest posts from WordPress site without header, menu and sidebar
- Why is my Blog Page ID == First Post ID?
- I want to display custom text widgets for each post in the sidebar?
- Is it possible to change post id for an already added menu item in WordPress?
- Get ALL post ID’s export list (Only id’s. Php or sql not important )
- Search results posts_orderby and ID
- remove post and categories/tags count from right now dashboard widget
- Retrieve post ID from “querying” URL
- How to get a post’s content? [closed]
- obtain the author id given the post id
- 2 dynamic sidebars registered, not showing up
- Sidebar show posts by current category also in single post
- Why I can not I use the variable outside my function?
- Widget that shows categories with posts numbers
- Getting Duplicate Posts on Home Page with Widget Added Between Posts
- retrieve the oldest post id
- Display current post position in Elementor Posts widget
- Custom posts listing widget always returns 1 extra result
- Need to know custom code to display random and most viewed posts in wordpress posts and pages
- Load widget only on blog posts
- WP_Query custom field pass the post id
- Accessing Post ID Within Loop
- How do post IDs work in WordPress?
- Are post, page and category IDs unique to each other?
- Adding a meta box to determine the sidebar [closed]
- linking to post outside the loop
- Making posts permalinks consistent numbers
- Sidebar limiting to 10 posts?
- Getting post and attached image from subdomain
- Conditionally exclude post from specific category on home page sidebar?
- How to get post id of last approved comment?
- Show 10 latest posts only from users with contributors role
- Display most recent posts in category with Twenty Ten theme widget
- How to show multiple posts thumbnail, title and date in widget
- Move position in post list for a custom checkbox column
- Add checkbox in admin post list – show checked post in widget
- Create a List of Widgets, where each widget holds three attributes
- WordPress Post ids big increment
- How can I create a ‘sub-blog’ which has its own sidebar on individual posts?
- How do i bring out post category name in my widget?
- Reuse old post ID for new post after deleting post
- Get post attachment with post id
- post__in no longer works in wordpress 5.0.3
- Single Sidebar; multiple templates! How?
- How can i take all ids from untrash_post action?
- How do I apply a wordpress function to something with no ID inside an archive page?
- Get from the dashboard the ID of the current post being edited
- How do I create a ‘selection’ criteria list’ that will then dictate which posts are generated when the user presses search?
- Creating widget – ask for selecting a post in the admin panel
- Surrogate ID for posts, is there an alternative field in the posts table?
- Is it possible to have dynamic post id # in add_menu_page()?
- Hide first blog post in content and output it in widget
- Correcting the content width when sidebar is inactive?
- Same sidebar in all posts as in the category
- Using Post ID and Page ID in same function
- unused post IDs
- How do I display the next 3 posts in the sidebar?
- How can to use the players from the Media Widgets in the body of a post to play audio and video files
- Custom post page has attributes of latest post [closed]
- get value from post to sidebar
- Can I get custom post items in select box (dropdown)
- How to add a widget area between blog posts in Genesis Framework?
- wordpress pinboard theme [closed]
- What is $post->ID
- View post with specific category id and name which I selected in the backend (drop-down option)
- How to get post ID after removing that post?
- Output number of WordPress posts remaining until a post milestone is reached
- Image inside the content is replaced with featured image from my older post