New answers tagged id
Post ID's are not necessarily unique. Ref. my answer on the post you linked to: http://wordpress.stackexchange.com/a/209832/71131 Within a Wordpress Multisite Network, id's are not unique. A blog post on one site can have the same id as a blog post on another site. Probably since each site has a separate database/table. (This just happened to me.) This is ...
Yes and No. Within a blog/site id's are unique. Unless they've been tampered with (by modifying the database's AUTO_INCREMENT, or reusing old id's, which would be a bad move). Within a Wordpress Multisite Network, id's are not unique. A blog post on one site can have the same id as a blog post on another site. Probably since each site has a separate ...
get_queried_object_id() will return the ID of the current single post or page being viewed, as well as the static front page. For any type of archive page (except date, custom post type and home archives), the following will be returned: Category ID of the category archive being viewed Tag ID of the current tag archive being viewed Author ID of the current ...
Please refer to the following post: Get post ids from WP_Query? You should be using: wp_list_pluck Example: $ids = get_posts( array( 'post_type' => 'contact', 'pages_per_post' => -1, ) ); var_dump(wp_list_pluck( $ids, 'ID' ));
Top 50 recent answers are included