Operation on all custom posts
-
I want to perform an operation to all posts of a certain post_type. However, the query to get all posts of this type does not terminate when I set ‘numberposts’ to -1. I would like to know if there is a way to understand what is causing this (memory or somekind of time) or an alternative way of performing an operation to all posts.
<?php /* Template Name: Update Maximum Threshold */ $args = array( 'numberposts' => -1, 'post_type' => 'my_type'); $posts= get_posts( $args ); if ($posts) { foreach ( $posts as $post ) { setup_postdata($post); the_title(); // Just to check that it is updated // The operation } } ?>
Thanks in advance
Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
- The topic ‘Operation on all custom posts’ is closed to new replies.