Hello,
I have a archive page named hotels. For some reason it is not working or displaying anything.
This is my code:
add_action('pre_get_posts', array($this, 'iar_hotel_archive')); public function iar_hotel_archive($query) { if ( $query->is_main_query() && $query->is_archive() ) { $query->set('posts_per_page', 1); $query->set('orderby', 'title'); $query->set('order', 'DESC'); } return $query; }
what am i doing wrong? I don’t get any errors at all.
Thanks!