[Support request] Content specific file in archive loop for custom post types

Home Forums Support [Support request] Content specific file in archive loop for custom post types

Home Forums Support Content specific file in archive loop for custom post types

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #1493044
    Jean-Patrick

    Hi Tom, hi GPTeam, hi GPUsers.

    First of all, thank you all for bringing us such an amazing tool!

    Sorry if the question has already popped up, but i didn’t find anything helping me out …

    I have created 4 different post types in a custom plugin, and I am now trying to customize the layout of each of them on the frontend.

    I am getting quite confused with the new “generate_do_template_part()” function, as now it seems we cannot go with the single-{$slug}.php or content-{$slug}.php in our child theme anymore. Or maybe I haven’t figured my way out yet. Maybe with Elements or such, but I do not get it right now …

    Is there somewhere an example of the way to deal with custom files for custom post types ? Or could someone show me an example code of a filter/action to use ?

    Thank you anyway for the work you’ve done !

    Keep going.

    JPH

    #1493527
    porkopolis

    Hey Jean-Patrick, I’m looking for answers for a similar issue. I’m checking the ” Notify me of follow-up” box to follow along. Thanks!

    #1493531
    Tom
    Lead Developer
    Lead Developer

    Hi there,

    generate_do_template_part() is just a wrapper function for get_template_part(): https://github.com/tomusborne/generatepress/blob/3.0.2/inc/theme-functions.php#L576

    The positive to the function is we now have actions and filters to work with so we can avoid using child themes in some cases.

    However, you can replace it in your child theme with get_template_part() without any issues.

    Let me know if you need more info 🙂

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