The post__in
parameter needs an array, see the WP_Query docs.
With your customizer field you are not saving an array, you are saving a comma separated string. So try something like this:
$my_field = get_theme_mod('fp_post');
// create an array from comma separated values
$the_post_id_array = explode(',', $my_field);
$query = new WP_Query( array( 'post_type' => 'post', 'post__in' => $the_post_id_array ) );
while ($query -> have_posts()) : $query -> the_post();
the_title();
endwhile;
See in the docs:
'post__not_in' => array( '1,2,3' ) // <--- this wont work
Related Posts:
- What are the ADVANTAGES of ORIGINAL wordpress template structure?
- Change admin bar to default:off
- How to change admin bar color scheme in MP6 / WP 3.8 front end?
- Template for individual post designs
- When to use esc_url, esc_html, esc_attr, and friends?
- Best practices – Should I create a child theme vs. customizing a framework theme? (such as HTML5 reset)
- How to disable 3.1 “Admin Bar” via script for the admin user?
- What is the best practice for customizing a plugin’s JavaScript/jQuery?
- Front End Post Submit Form
- How the WordPress sidebar works
- Should we localize custom-made themes / plugins?
- Change loop order via form or link (jquery, not URL)
- Extend walker – navigation, adding data attribute to a tag
- How can I remove the Static Front Page option from the Customizer
- Set front page as static page [closed]
- How to programmatically bring back “excerpts” field in post editor in WP 3.1+
- How can i customize the comment list
- When developing a distributable Theme, does it HAVE to be “inheritable”?
- How to handle theme customization and sass variables
- wp_enqueue_scripts not called on search page?
- wp_head() not inserting the default stylesheet style.css
- First completely customized theme, where should I start?
- WordPress how to override function adjacent_posts_rel_link_wp_head() in link-template.php the correct way
- Theme Customizer not loading
- How to retrieve an image from a post and display it before excerpt of a post? [duplicate]
- Modify Javascript Configuration Options for Theme Customizer Colour Picker
- Best practices: Custom theme sidebar menu – hardcode or widget?
- Best approach to create sites with Modular Content? [closed]
- What’s the best action to use when you want to do something only once per theme setup?
- Customizer API and add_panel(). Panel doesn’t show
- How to correctly add JQuery in a WP theme?
- Creating multiple hooks for theme
- What is the best way to handle multiple calls to get_template_directory_uri() and similar functions?
- Best way to start becoming a wordpress developer
- Removing non native customizer settings from a child theme
- How to reorganize the items returned by wp_list_comments()?
- which is the best way to customize nav-menu-template.php?
- Where should I update_options in a theme?
- WP 3.1 upgrade breaks AutoFocus+ theme
- Displaying recent post excerpts on static front page
- Customizer: Unique identifier that distinguishes which image upload control is uploading an image
- How to make theme elements customizable in wordpress?
- How do I Add images uploaded in the post to a default custom field
- How to add a button which saves the post then executes a function
- Limitations when modifying wp_title with a filter
- How to edit theme functions file to modify pagination?
- Disabling Customizer Selective Refresh shortcut icons for selected controls
- “Add A Widget” button in the Customizer
- Zoom on custom theme without child
- Q: How to pull data from custom table to populate zustomizer setting/control select options
- Move default page templates to sub directory
- Changing a slider to a grid [closed]
- Custom Navigation build using wp_nav_menu and walker
- Using My Own Classes On Wp Unit Tests
- Is it possible to visually group items on the theme customizer?
- WooCommerce: multiple input field for multiple product variations
- Customizer – loading settings/controls/sections/panels based on a id/page id
- Integrate WooCommerce theme with a WordPress theme [closed]
- How do you use WordPress for a website that’s not in a blog format?
- Child Theme header1.php file not overwriting parent theme’s header1.php file
- How to have content scroll over background
- Replace site title with logo when logo is uploaded in customizer using
- Is there a WordPress boolean for “theme_customizer_active()”?
- Extending Twenty Eleven Theme
- Templates without a loop, best practice?
- searchform.php doesn’t work properly
- CSS added through customizer neglects the need of a child theme?
- Customizer: get_preview_url() inside customize_save_after hook
- How to add custom meta box when you have a custom page template file
- add shortcode support in customizer
- Clearing dummy data before launch
- How to call a widget in a loop at a specific iteration value?
- Right procedure when you develop a WP Website for a client
- New to WordPress – Read the Codex, Other Docs; Still Confused
- How to add custom page elements to the WYSIWYG editor?
- Update Specific Key Value in Complex `wp_options` object
- Can’t change theme name
- My contact form – I’ve changed the source code but the changes are not being applied
- How to custom category template based on category?
- How to use multiple check-box values to work in a function and insert values in database
- Text View (Code View) in WordPress Customizer TinyMCE Editor
- What is the best practice workflow for new website overhaul and keeping current SEO ranking? [closed]
- HTML TO WP Theme : Submenu goes down wp_nav_menu
- Add a customize control depending wich radio setting is checked
- Any way to permanently translate themes?
- Undefined index: custom_sidebars
- How to share posts (and plugins) between existing site and new, separate dev/test installation?
- How to prevent XSS attack in wordpress theme?
- Customizer API way function is_customize_preview() works only in main page?
- page.php is not called when I load a Page
- Support Multiple featured images
- WordPress 3.5 + Foundation 5 not working on IE9
- What hook to use for loading a custom class extension during Theme initialization?
- trying to figure out how to use more that one image upload in the same section in theme customizer
- Theme Option’s Save Button is not working
- Best practice to create required pages
- Permalinks problem with custom theme
- How can i move my product name & price from below thumbnail to be the rollover content in Avada & Woocommerce?
- How to split the site’s layout without damaging this layout? [closed]
- Multiple content areas with Gutenberg – Transparent areas mid content