try:
$not_in = get_option('sticky_posts');
$not_in[] = $post->ID;
$myposts = get_posts(
array('cat' => "$cat,-$catHidden",
'post__not_in' => $not_in,
'numberposts' => 10;
)
);
foreach($myposts as $idx=>$post){//do something}
hope this helps
Related Posts:
- How to return only certain fields using get_posts()
- Why Does get_posts() Return an Empty Set?
- get_posts / WP_Query Memory size of 134217728 bytes exhausted
- Ordering posts by metadata
- get_posts() not working when accessing with a custom user role
- get post attachment using ajax
- How to get post content by get_posts function?
- Why does my widget break other widgets?
- Delist entries in the_loop
- Custom query not working in plugin admin page
- How do I query posts and have their related taxonomies returned in the results?
- filter on get_posts efficiently
- A better way of getting draft posts that has a particular post meta using get_posts function
- Autoloading & Namespaces in WordPress Plugins & Themes: Can it Work?
- How can I add an image upload field directly to a custom write panel?
- Creating a table in the admin-style?
- How to output message during plugin activation
- On the WordPress Admin section how do I link to submenu pages created for a plugin?
- How to provide translations for a WordPress TinyMCE plugin?
- Where do I start from
- Where is it better to start learning how to develop for WordPress?
- How to log plugin errors to plugin error_log file
- Is there any way to test if a function running only on plugin update is successfully running?
- Using wp_cron with custom time interval and the register activation hook
- Throw 403 in a plugin [duplicate]
- WordPress multisite apply different options over each site from same plugin
- Change of query var in pre_get_posts not maintained
- Hook for post permalink update
- How can I view all WP generated thumbnails in Media Manager?
- Only allow plugin to be activated on root site of multisite
- Menu Error in Admin Console with Custom Plugin: You do not have sufficient permissions to access this page
- Load page template with custom content using a plugin
- How to put placeholder text in the main post input area?
- Will changing the ‘Plugin Name’ header in the next update of a plugin break anything?
- Performance of several get_option() calls
- how to redirect to another post without getting headers already sent error?
- Problem with is_active_sidebar?
- Prevent Plugin from loading on ‘wp-admin / wp-login’
- Redirect user to a particular link in 10 seconds after using wp_die
- Getting admin notices working for plugin errors
- Change template dynamically
- add a class when login
- override pluggable.php functions
- An echo line in a transition_post_status action leads to “cannot modify header information – headers already sent by”
- Programmatically detect if wp-cron is disabled?
- Widget is to be compatible with all themes
- How to remove the current post from the query?
- Passing nonce at admin menu link
- how to get up row in wordpress with wpdb
- Preview plugin store details
- Prevent third party plugin’s admin page access based on user type
- Get attachments from a post
- How to remove default style of header in wordpress metabox
- I have 2 plugins using the same wp_login action hook and one is not working
- TEMPLATEPATH without the theme name? No THEMEPATH constant?
- WP and object persistence (or lack thereof)
- UWooCommerce – add cart discount programmatically?
- Bad Request in AJAX
- Remove sidebar on single page using plugin API
- When does save_post hook fire on post save/update
- Enqueuing scripts and styles in custom plugins
- Include file in plugin file
- Shortcode not appearing when used as post content in wp_insert_post() or possibly, shortcode not being registered at all
- Plugin language always shows WP site language, not profile language
- Adding custom stylesheet into header.php using a plugin
- Developing the save function in Gutenberg blocks
- Creating an installation zip file
- update_callback is not working in register_rest_field
- Detect change in site_url and home_url
- Reporting errors in a shortcode plugin
- Adding Custom CSS with PHP
- How to remove/replace current page template?
- How do I add a menu item to a Pods admin menu?
- Is there a way to add a link with add_post_meta?
- Using password protection to load different page elements?
- How to Show Category List With Corresponding Links?
- .htaccess with WordPress – create my own pretty url with parameters (above WordPress settings)
- Generating a password-protected front-end page via a plugin
- How do I add a 5 digit ZIP code validation to a Contact7 form?
- wp_remote_post not working with admin-post.php
- How can we stop showing short code in create or edit post section
- Default media uploader is not showing in wordpress website
- Delete Plugin Options with Verify
- Load custom translation in custom plugin fails
- “Headers Already Sent” Nightmare on Plugin
- set a custom post type to a taxonomy term programmatically in metabox
- Uncaught ReferenceError: kpoejy is not defined
- Is there better way to do this without duplicating queries?
- How to create a simple plugin which show/hide an html code in wordpress?
- How to create custom frontend php page via plugin
- How can I add recent posts to menu like mashable
- Translation of plugin Upload button
- Changing upload directory for plugin uploads only
- Create wordpress dashboard metabox which spans all columns
- add_filter adds output in the head
- How can i add insertion point between inner blocks in my custom block like core blocks
- Update option hook not firing
- $_GET vs get_query_var()
- Load images from CDN and custom features to “Add Media” dialogue
- Saving metabox updates causing fatal error