If $my_share echoes as “5171,5167,5165” then it is a string not an array…
In other words array($string)
does not equal array(integer,integer,integer)
even if $string
equals “integer,integer,integer” because array treats $string as a single value with further values separated by commas.
You could use post__in => explode(",", $my_share),
to convert the string into an array while passing it… otherwise you could try just using post__in => $my_share,
and it might be converted into an array for you (but not sure without delving deep into the code to look.)
Related Posts:
- if ( is_home() && ! is_front_page() )
- How can i display the content in plaintext
- Why am I being limited to ten posts on a custom loop?
- Child Pages Loop
- Loop.php vs looping inside template file
- Insert/sticky specific post into Loop at specific location
- Style every four posts differently [duplicate]
- Return vs Echo Shortcode
- have_posts() return false but count says “3”
- next_posts_link not working in custom loop
- Ajax loop in sidebar to load post titles/categories
- How to sort posts in archive loop
- wordpress loop and template files
- wordpress post loop in javascript
- How to iterate through database until it find a match
- Show top level comments ordered by number of replies
- Creating nested forum loops in bbPress [closed]
- Redirect Loop to Page, Can’t Find Origin, Can’t Remove [closed]
- Loop through pages with specific template
- Loop starts from the beginning with second while loop on author.php
- wordpress change the loop order by dynamic value
- Post Format single-loop.php using get_template_part
- Display posts from multiple user roles
- Single page site (WordPress) including posts
- Meta Query with spaces in value?
- A loop with all articles with certain text strings in tags
- Prevent Headers from being sent
- How do I get row padding in a post feed?
- How can I create a legend (Key) like the one in the footer on WordPress StackExchange
- It is possible to encounter horrible bugs if I place a main loop that uses `query_posts` right above the main bbPress loop?
- Styling text and images in the_content()
- How do I use AJAX Query in my posts loop?
- How to show “teaser” posts on blog / archive pages, otherwise full posts
- Make blog page show 10 on first page, 9 on every other page
- Output loop leveraged shortcode twice on one page
- Alter query using pre_get_posts() if meta_key is present
- Next Posts Prev Posts for Standard post format only
- Two loops on different pages do the same thing, but only one page works
- Posts active and expired in different loops
- Genesis multiple category custom loop 404s after first page
- Shortcode in posts called by ajax is not working
- Using Javascript for Looped Content
- How to get The Loop working with $wpdb->get_results()
- Making a query to the DB using same parameters of loop
- Update status of all posts in a category
- is_active-sidebar loop
- Loop counter style
- Can I add generic numbering HTML classes to items as a loop runs?
- Add “showing posts x to x of y” in custom post type paginated loop
- Custom Post Type on Homepage – Studiopress Genesis Framework
- New loop vs widget
- Display a single category in blog section
- Query Nopaging action not having effect
- Yoast taking over my WordPress title tag [closed]
- Pagination broken after using 2 loops to show content
- Getting page slug
- How to get pagination to work with 2 wordpress loops
- How do i find and restore a sidebar that i accidentally deleted? [closed]
- Exclude page from loop results
- How is WordPress changing the content markup?
- Inserting CPT and static content at every X post, is this possible?
- loop through posts and display inserted media and post title as a link
- using update_user_meta to rank users
- Can’t grab author info outside of the loop
- Custom Blog Loop on Home Page
- Exceprt not displaying
- Add File Attachment Name and URL into Javascript
- Open Graph in Index Loop
- How to tell if all posts are only in one category?
- How do I set the Stewart Search Template to return only published posts in the result
- How to add Default Level-0 parent and Level-1 class in WordPress Category in li element?
- Updating Post meta (ACF field) from Feed
- How to add pagination in Terms
- A code that I could not fully grasp related to foreach & count_user_posts()
- How to separate post titles with a comma in the loop?
- get_posts changes main query
- Trying to get property ‘post_content’ of non-object
- WordPress loop : how to exclude some posts with their status?
- Homepage Loop Somehow Breaks Styling Of Post Grid
- Foundation modal in wordpress php loop
- Next 10 posts data of currently viewing post in blog page
- Have multiple loops on a page appear after/between page content
- How to fix pagination for custom loops?
- Get gallery and product gallery images full size
- WordPress Multiple Loop: Home/Archives Page, with pagination
- Placing the content of one post in two side by side columns, newspaper style
- trying to write a variable into a wp_query, need help!
- One loop for sticky, one for all the rest – how, without specifying category?
- Pass WP post content to a jQuery plugin (Fancybox)
- Showposts doesn’t show the number of posts indicated
- Using in_category for non standard loops
- Use Loop or direct database query?
- How wp maps urls into files
- Custom Page Template and Category Exclusion
- Display Featured Image
- AJAX in wordpress theme loop
- Duplicate post problem
- How to get files from loop for zip
- Divide loop into several columns based on post custom field and enable infinite scrolling
- Query Loop Block: possible to restrict just child pages?