Upfront and CustomPress

Custom fields need to be added to the custom post template, of an Upfront theme. Into which template PHP code of a custom filed needs to be embedded?

  • Majid

    Hello juan
    I hope you are doing great today :slight_smile:

    Both CustomPress and Upfront Builder should be able to detect your custom post type, Event if it's not created using CustomPress.

    So to display custom fields created using CustomPress, You need to create a new Custom field first
    CustomPress > Custom Fields add new, and make sure it's related to the post type you want to display in. (Equipo) in your case.

    Save it, and copy the shortcode from here

    Once that done, the next step would be creating the custom post template. Open the Builder > Layouts and Create a new template, You should see 'single-your-custom-post-type-name' template, in your case it will be Single Equipo.

    Now you need to grab a text element from the Builder elements sidebar, drag it to the template content, and insert the shortcode you copied earlier

    And this won't require any PHP editing, if the custom post type have the custom fields already setup. You should be able to see the results right away.
    In my case I have an Article custom post type, with a custom fields called Author, the results are like the following.

    Let me know how did it go. And if you need further assistance, just let me know in a reply I'll be happy to help :slight_smile:

    Thanks,
    Majid

  • juan

    Hi Majid,

    Sorry but this not is the solution that I want..
    In upfront I know how to add it.

    I'm trying to add this CustomField in a GoPortfolio template:

    <div class="gw-gopf-post">
    	<div class="gw-gopf-post-header">
                {{post_media}}
                <p class="titleWork">{{post_title}}</p>
                <?php echo do_shortcode('[ct id="_ct_text_5a60c77706933" property="title | description | value | link | image"]'); ?>
    	</div>
    </div>

    GoPortfolio plugin comment the PHP lines for some reason If I put directly in her template and, your partner Nastia told me that I want to add this shortcode in some files via FTP. At that moment the connection was lost and I did not understand what files he was referring to...

    Regards

  • Majid

    Sorry for the misunderstanding juan , In fact I'm still a little bit confused how this Go Portfolio plugin works, I see that it creates custom post types and allows you to give them templates, But the issue here is that the templating system offered by the plugin doesn't allow direct PHP code insertion.

    And since this is a Post type and Upfront Builder is able to detect it. I'm not sure if Go Portfolio template is even needed.

    You can just use Upfront Builder > Edit current theme, and edit the post type layout from there, exactly like what I did in the 2nd step of my first reply.

    Let me know what do you think.

    Cheers,
    Majid

  • Majid

    Hey juan

    After checking the plugin Forums, I managed to find the shortcode used within the template to display custom fields, which is :
    https://codecanyon.net/item/go-portfolio-wordpress-responsive-portfolio/5741904/comments?page=30&filter=all#comment_6615880
    [gopf_meta key="my_customfield" post_id="{{post_id}}"]

    So doing something similar, with changing the attribute value of course to the actual ID
    (_ct_text_5a60c77706933 ) That you can get from CustomPress > Custom Fields > Field ID column

    Now the final shortcode will look like this
    [gopf_meta key="_ct_text_5a60c77706933" post_id="{{post_id}}"] I have already added it to the Go portfolio template (Default Template 4 (only excerpt)) and the results are like this

    Best Regards,
    Majid

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.