I’m doing some custom loops that I initialize with a query like this

$the_query = new WP_Query('page_id=266');

It works fine. It’s just I’ld to call my page with its slug and not its ID.

Would it be possible ?

1
1

use pagename= to query by slug. See WP_Query for full list of valid arguments.

Tags:

Leave a Reply

Your email address will not be published. Required fields are marked *