New Landing How can we help? Themeforest Theme Support Flexform Best method to create custom fields in Flexform Theme

Viewing 6 posts - 1 through 6 (of 6 total)
  • Posted in: Flexform
  • #243154
    foundation_design_nz
    Member
    Post count: 9

    Hi, I have a client who has an existing site using your Flexform theme.

    I have a testing site at http://50.6.112.103/ where I’m running a copy of thier live site and I’m develeoping new features.

    We are wanting to add the ability for my client’s customers to create a post that contains custom fields i.e Goals, Commitments, Strengths, etc. This post (and further posts) will show on their profile page and they will have the ability to edit these posts. (see a mockup @ http://50.6.112.103/properos-diversity-and-inclusion-embedding-tool-mockup-post/ )

    I’m hoping to setup a front end ‘create a new post’ page using Gravity Forms and lock down the admin area for back end access to edit these posts.

    I have used a plugin called wp-types to create a new post type and custom fields. https://wp-types.com/home/types-manage-post-types-taxonomy-and-custom-fields/

    So far so good.

    What I’m struggling with is how to, and where to add the code for the custom fields.

    Should the code be written in the single.php page? If so, where should I put the code?

    Or do I add a page called single-goal.php If so, where should I put the code?

    Or do you have a better solution as to how I should achieve this?

    #243177
    Mohammad – SUPPORT
    Moderator
    Post count: 27441

    Hi,
    If you create custom field to custom post then put code at single-goal.php file otherwise put code at single.php.
    Thanks
    Mohammad

    #243257
    foundation_design_nz
    Member
    Post count: 9

    Thanks for your reply Mohammad.

    Can I trouble you for some more details in how to create and set up a single-goal.php file please?

    To create a single-goal.php file… would I just duplicate the single.php file and rename it single-goal.php, edit it and put it in the Flexform theme folder?

    To edit this new single-goal.php file and add my custom fields… would I use this code

    <?php

    echo types_render_usermeta_field( “goal”, array( “user_current” => true ) )

    ?>

    And if so where do I put it (what line?) in the single-goal.php file?

    Many thanks.

    #243262
    David Martin – Support
    Moderator
    Post count: 20834

    Hi,

    Sounds like in your case, this will help you: http://www.advancedcustomfields.com/.

    Thanks.

    #243610
    foundation_design_nz
    Member
    Post count: 9

    Hi David,

    cheers for the link. That helped with getting my head around PHP and I created a new single-goal.php file that is show all my custom fields… wahoo!

    I have a new problem though in that I can’t seem to be able to ‘shortcode’ the new post type (goal). In the past I have used Swift Page Builder’s Blog Element to place the ‘posts on a page… but the Blog Element won’t pick up this new post type (presumably because the posts are goals and not posts).

    Can you give me a heads up on how to resolve this please.

    Note: as a work around I suppose I could make my goals a post and give it a category to separate it out

    #243715
    David Martin – Support
    Moderator
    Post count: 20834

    Hi,

    The file is /wp-content/themes/flexform/includes/page-builder/composer/lib/shortcodes/blog.php

    On line 118, you will see this

    'post_type' => 'post',

    You can edit that to add your new post type or pass a post type variable to it.

    Thanks.

Viewing 6 posts - 1 through 6 (of 6 total)

You must be logged in and have valid license to reply to this topic.

License required for one of the following items
Login and Registration Log in · Register