[Resolved] Override layout for custom post type archive

Home Forums Support [Resolved] Override layout for custom post type archive

Home Forums Support Override layout for custom post type archive

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #1818492
    Simone

    Hi there,

    I created a custom post type called client_portfolio. I want to override the default archive template, so I created an archive-client_portfolio.php file in my child theme, as I generally do.

    Unfortunately this solution doesn’t work with GeneratePress.

    Is there a solution?

    Thanks,

    Simone

    #1818619
    David
    Staff
    Customer Support

    Hi there,

    when you registered the CPT does the args include: 'has_archive' => true,

    #1818854
    Simone

    Hi David,

    yes, it looks like this:

    'has_archive' => 'projects',

    Thanks,

    Simone

    #1818888
    David
    Staff
    Customer Support

    Change it to 'has_archive' => true, then by default it will use the archive slug that matches the $post_type ( eg. client_portfolio )

    #1820085
    Simone

    Thank you, that works.

    Cheers,

    Simone

    #1820929
    David
    Staff
    Customer Support

    Glad to be of help.

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