Navigation
This is archived content. Visit our new forum.

Tagged: 

  • Author
    Posts
  • #1417630

    Gnomo Bàgnolo
    Participant

    Hi there

    Is there a Best Peactice to follow in order to replicate (in a Child environment) the Portfolio Post structure, in order to use this replicated structure for Custom Post?

    Thank You

    #1417712

    Rahul
    Moderator

    Hey There,

    Thanks for writing in!

    Regretfully, at this time I am not entirely certain what it is you’re trying to do.
    If you wouldn’t mind providing us with a little more clarification on what it is you’re wanting to do. We’ll be happy to provide you with a response once we have a better understanding of the situation.

    Thanks for understanding!

    #1417842

    Gnomo Bàgnolo
    Participant

    I’m sorry (for my confusion)

    I try to explain better my request

    I’d like to create a NEW Custom Post Type and create a new Template (using x-portfolio template structure).
    Something like explained here:

    Custom templates for custom post types


    or

    Is there a “Best Practice” in order to create this kind of customization?

    Thank You

    #1418508

    Rad
    Moderator

    Hi there,

    You have to create templates for every post type, you can’t re-use existing x-portfolio templates (eg. sharing single templates). But you can duplicate x-portfolio templates and rename them to your preferred post type templates.

    These are the x-portfolio templates

    /x/template-layout-portfolio.php
    /x/single-x-portfolio.php
    /x/framework/views/global/_portfolio.php
    /x/framework/views/global/_script-isotope-portfolio.php
    /x/framework/views/{SELECTED STACK IN CUSTOMIZER}/content-portfolio.php
    /x/framework/views/{SELECTED STACK IN CUSTOMIZER}/template-layout-portfolio.php

    You can duplicate them to your child theme and rename them, and while you rename them you should also change some code to match the renamed files.

    Example, Let’s say this code

    <?php x_get_view( $stack, 'content', 'portfolio' ); ?>

    You created a duplicate of

    /x/framework/views/{SELECTED STACK IN CUSTOMIZER}/content-portfolio.php
    to
    /x/framework/views/{SELECTED STACK IN CUSTOMIZER}/content-work.php

    then the code will be

    <?php x_get_view( $stack, 'content', 'work' ); ?>

    Some features are only available for portfolio post type and you’ll not able to replicate them.

    Hope this helps.