• Resolved szymonnt

    (@szymonnt)


    Hi,

    I wanted to keep things organized, so I created a custom post type specifically for affiliate area pages and pages related to partner offers. However, I found that in the SliceWP settings, I am unable to assign the account page, registration page, etc., to the newly created posts under the new post type. Only “pages” (post-type) are available for selection.

    The page I need help with: [log in to see the link]

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author iova.mihai

    (@iovamihai)

    Hey @szymonnt,

    Thank you for reaching out! Yes, you are correct. Currently, only pages are shown as options. You can however extend the options available with this code snippet:

    function slicewp_custom_get_pages_general_settings_cpt( $pages ) {

    $post_type_slug = 'your_post_type_slug';

    if ( empty( $_GET['page'] ) || $_GET['page'] != 'slicewp-settings' ) {
    return $pages;
    }

    if ( ! is_admin() ) {
    return $pages;
    }

    $pages = array_merge( $pages, get_posts( array( 'post_type' => $post_type_slug, 'number' => -1 ) ) );

    return $pages;

    }
    add_filter( 'get_pages', 'slicewp_custom_get_pages_general_settings_cpt', 100 );

    Please copy the code and add it to your website. If you’re not sure how to add code snippets to your site, you can use the Code Snippets plugin (https://www.ads-software.com/plugins/code-snippets/).

    Please make sure to replace the “your_post_type_slug” value with your actual post type’s slug.

    Thank you and best wishes,

    Mihai

    Thread Starter szymonnt

    (@szymonnt)

    Great! Thank you!

Viewing 2 replies - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.