• Skip to main content
  • Skip to forum navigation

StudioPress

  • Shop for Themes
  • My StudioPress

Forum navigation

  • Home
  • General Genesis Discussions
  • StudioPress Themes
  • Genesis Blocks
    • Genesis Blocks
    • Genesis Custom Blocks
  • Retired Themes
  • FAQs
  • Forum Rules
  • Internationalization and Translations
  • Forum Bugs and Suggestions
  • Forum Log In

Are You Using The WordPress Block Editor?

Genesis now offers plugins that help you build better sites faster with the WordPress block editor (Gutenberg). Try the feature-rich free versions of each plugin for yourself!

Genesis Blocks Genesis Custom Blocks

Genesis Portfolio Pro plugin – custom templates

Welcome!

These forums are for general discussion on WordPress and Genesis. Official support for StudioPress themes is offered exclusively at My StudioPress. Responses in this forum are not guaranteed. Please note that this forum will require a new username, separate from the one used for My.StudioPress.

Log In
Register Lost Password

Community Forums › Forums › Archived Forums › Design Tips and Tricks › Genesis Portfolio Pro plugin – custom templates

This topic is: not resolved

Tagged: Custom Post Type, Genesis Portfolio Pro

  • This topic has 10 replies, 2 voices, and was last updated 4 years, 8 months ago by canpress5.
Viewing 11 posts - 1 through 11 (of 11 total)
  • Author
    Posts
  • June 28, 2018 at 8:53 pm #221206
    canpress5
    Member

    With the Genesis Portfolio Pro plugin I can customize the single-portfolio.php template which will allow me to use the same custom layout for all portfolio items.
    What if I want to use several different custom templates for my portfolio items, is there a way to select from a list of templates when you add a new portfolio item, in the same way that you can select from a list of templates for a regular page?
    Or is there another way to achieve the same thing, ie choose from multiple templates rather than have every portfolio item use the same template (single-portfolio.php)?

    Any ideas or relevant links would be much appreciated!

    June 28, 2018 at 9:49 pm #221211
    canpress5
    Member

    I managed to find the answer to this here.
    To have different templates appear in the 'Page Attributes' section of the 'Edit Portfolio Item' screen you need to add 'portfolio' (or other custom post type) to the list of post types at the top of the template file, eg:
    ` <?php
    /*
    Template Name: Your Template
    Template Post Type: post, page, portfolio
    */
    // … your code here `
    Then add the template to your child theme's root.

    June 29, 2018 at 3:04 pm #221221
    canpress5
    Member

    I was a bit premature in marking this thread as resolved.

    Further to the above post, although you can select a custom template for your portfolio item (as described above), that custom template is not actually used and Genesis Portfolio Pro defaults back to single-portfolio.php.
    So, as far as I can tell you can only use one customized template within Genesis Portfolio Pro, namely a customized version of single-portfolio.php. Is this correct?

    June 30, 2018 at 12:03 am #221228
    Brad Dalton
    Participant

    Use code to create a CPT and add your own templates in your child theme.


    Tutorials for StudioPress Themes.

    June 30, 2018 at 10:44 am #221248
    canpress5
    Member

    Thank you Brad, will give that a try.

    June 30, 2018 at 10:47 am #221249
    Brad Dalton
    Participant

    If you didn't already know, you can copy and name the templates using the WordPress Template Hierarchy so they load on specific custom taxonomy archives. https://developer.wordpress.org/themes/basics/template-hierarchy/#custom-taxonomies


    Tutorials for StudioPress Themes.

    June 30, 2018 at 11:23 am #221252
    canpress5
    Member

    In another thread I asked whether it was possible to choose from multiple archive templates for one CPT.
    Is this how you would achieve that? (ie using different taxonomy-{taxonomy}.php templates rather than different archive-{post_type}.php templates?)

    June 30, 2018 at 8:23 pm #221261
    Brad Dalton
    Participant

    For the CPT archive, you would only use 1 template but if you wanted to create multiple archives for 1 CPT, you could add a template header

    if your question relates to using different templates for each custom taxonomy, then yes, you would name the templates according to the WordPress Template Hierarchy so they load on archives for different taxonomy types.

    As far as using the page_team.php file, you would need to modify the code in †he template to do this as it uses WP_Query.


    Tutorials for StudioPress Themes.

    June 30, 2018 at 10:34 pm #221266
    canpress5
    Member

    Brad,
    Can I ask your advice to make sure I'm heading in the right direction?

    My site features several Case Studies each of which is a substantial page in its own right and is not time sensitive (unlike a news item or blog post). New Case Studies will be added to the site on an ongoing basis. Because the content is 'timeless', in my mind each Case Study page should be a Page and not a Post.
    Using different versions of the page_team.php template I can create several parent pages for these case studies to group them into different categories.
    My only problem is that some of the case studies belong to more than one category and they can only have one Parent page each, so having the case studies as Pages does not allow me to use more than one category for each case study.
    I have come to the conclusion that using a Case Study CPT with taxonomies for the categories is the best solution, would you agree?

    As far as using the page_team.php file, you would need to modify the code in †he template to do this as it uses WP_Query.

    For the above scenario I would like to create a CPT archive template which produces identical output to page_team.php, ie using custom fields/ACF rather than the typical archive page output. Do you have any tutorials relating to this?

    June 30, 2018 at 10:56 pm #221268
    Brad Dalton
    Participant

    1. I have come to the conclusion that using a Case Study CPT with taxonomies for the categories is the best solution, would you agree?

    Standard posts and categories are the easiest to work with however provided you have the templates i linked to, you can fairly easily create your own custom taxonomy types for a CPT. Personally, i would use standard posts and categories.

    2. I don't have any tutorials for this at the moment. A custom template would take some time to code, test and then publish. You could try yourself using the page_team.php file.

    Note : Also, it would be hard to code the template which includes ACF fields you need without setting up the ACF inputs using your json export.


    Tutorials for StudioPress Themes.

    July 2, 2018 at 12:16 pm #221286
    canpress5
    Member

    Thank you for your insight Brad!

  • Author
    Posts
Viewing 11 posts - 1 through 11 (of 11 total)
  • The forum ‘Design Tips and Tricks’ is closed to new topics and replies.

CTA

Ready to get started? Create a site or shop for themes.

Create a site with WP EngineShop for Themes

Footer

StudioPress

© 2023 WPEngine, Inc.

Products
  • Create a Site with WP Engine
  • Shop for Themes
  • Theme Features
  • Get Started
  • Showcase
Company
  • Brand Assets
  • Terms of Service
  • Accptable Usse Policy
  • Privacy Policy
  • Refund Policy
  • Contact Us
Community
  • Find Developers
  • Forums
  • Facebook Group
  • #GenesisWP
  • Showcase
Resources
  • StudioPress Blog
  • Help & Documentation
  • FAQs
  • Code Snippets
  • Affiliates
Connect
  • StudioPress Live
  • StudioPress FM
  • Facebook
  • Twitter
  • Dribbble