My endpoint works on all kind of single pages and homepage, but it returns 404 in archive pages, either categories or custom taxonomes. I have reflushed rewrites but I don't get it work. This is my code:

add_action( 'init', 'add_amp_custom_endpoints', 1000 );

function add_amp_custom_endpoints() {
    define( 'AMP_QUERY_VAR', apply_filters( 'amp_query_var', 'amp' ) );
    add_rewrite_endpoint( 'amp', EP_ALL );

Any suggestion? Thank you!

  • Rewrite endpoints should added on the init action. – Milo May 28 '18 at 15:05
  • I did it but it doesn't work either. I checked the rewrite rules list and there'n no any amp rewrite rule. If I replace EP_CATEGORIES by EP_PERMALINK, all post_types got my custom endpoint, but categories don't. – retroriff May 29 '18 at 7:21

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.