• Hello,

    I am creating very advanced form that have to be easy possible to add new/edit sections and subsections.

    I did it with Advanced Custom Fields plugin and “page” post type as it’s nice to use page hierarchy and page order. (Display appropriate boxes from ACF and use hierarchical functions in loops.)

    Problem is that pages should be treated as “not exists”, so only for ACF data, galleries (I am using them for creating inputs in form) etc.

    Alternatively I could rebuild them on custom post type, but I have some bad experience from past that it often get broken. And I would be “free” from my client with such problems. Or maybe I used wrong plugins?

    However, what’s the correct way to use posts for “store” data only?
    Should I migrate to custom post type or did some tricks like following?

    function rr_404_my_event() {
      global $post;
      // Match if is that page is child used only for data
      if ( $statement ) {
        global $wp_query;
        $wp_query->set_404();
        status_header(404);
      }
    }
    add_action( 'wp', 'rr_404_my_event' );

    If so, anyone knows function to exclude them from Yoast SEO’s XML Sitemap (not by ID, as client could add more sections) and add them noindex?

    Example structure what I am talking about:

    1. Page with form visible for user
    1. Def First section’s data (page order 1)
    1. Subsection of above
    • Abc Second section’s data (page order 2)
    • Thanks in advance for advices!
      Greetings

Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
  • The topic ‘Use "page" post type for data only’ is closed to new replies.