Hot answers tagged

1

Use wp_list_pluck to extract an array of IDs from your query, then pass those to is_page. $top_level_ids = wp_list_pluck( $top_level_pages, 'ID' ); if ( is_page( $top_level_ids ) ) { // do something }


1

Even though the recommendations have been updated to: To run WordPress we recommend your host supports: PHP version 5.6 or greater MySQL version 5.6 or greater OR MariaDB version 10.0 or greater the minimum requirements are not there yet: WordPress server requirements for Version 3.2+: PHP version 5.2.4 or greater MySQL ...


1

2 choices here, you either need to set the category as an array e.g. $args = array( 'posts_per_page' => 5, 'category' => array(15,16,17,18,19) ); You can't just add the numbers in a list but I can't find any documentation that the category element allows multiples (as the name is category) The other option is to use wp_query and category__in $...


1

You have a problem in the array construction. You have that : $args = array( 'posts_per_page' => 5, 'category' => 15, 16, 17, 18, 19 ); And you probably need that : $args = array( 'posts_per_page' => 5, 'category' => [15, 16, 17, 18, 19] );



Only top voted, non community-wiki answers of a minimum length are eligible