Multiple SQL query, but it is not necessary
-
1) register multiple CPT
2) set page to archive via option page
3) look over plugin Query MonitorI have 5 CPT with archive page. Plugin create 5 SQL query, which can be handled by 1.
public function initialise() { $this->basename = plugin_basename(__FILE__); if ( $pages = array_unique( array_filter( array_values( (array)$this->get_config() ) ) ) ) $cache_pages = get_posts( array( 'post_type' => 'any', 'numberposts' => -1, 'post__in' => $pages ) );change get_page to get_post
public function get_archive_page( $slug = null ) { $page_id = $this->get_archive_page_id( $slug ); return $page_id ? get_post($page_id) : null; }
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
The topic ‘Multiple SQL query, but it is not necessary’ is closed to new replies.