3 | | $page=get_page_by_path(...., ..., 'page'); |
4 | | if ($page) .... |
| 3 | //PAGE exists... with the found slug("TORNADOO"), lets check if it's a really page.. |
| 4 | $page=get_page_by_path('cars/subcat/TORNADOO', OBJECT, 'page'); |
| 5 | if ($page){ |
| 6 | //new query |
| 7 | $query->init(); |
| 8 | $query->parse_query( array('post_type' =>'page') ) ; |
| 9 | //others |
| 10 | $query->is_home = false; |
| 11 | $query->is_single = false; |
| 12 | $query->is_singular = true; |
| 13 | $query->is_page = true; |
| 14 | $query->queried_object_id = $page->ID; |
| 15 | $query->set( 'page_id', $page->ID ); |
| 16 | return; |
| 17 | } |