WordPress function url_to_postid not working with Anspress

With the Anspress theme/plugin, using the WordPress native function url_to_postid() on a question permalink returns the page ID of the base page. For example,

would return the page ID of the /questions page.

To get the WP question ID of this-is-the-question, use the following:

(using get_post_types() instead of ‘questions’ allows the call to work even with permalinks of non-question contents.)

Lascia un commento

Il tuo indirizzo email non sarĂ  pubblicato. I campi obbligatori sono contrassegnati *