• Resolved ominem

    (@ominem)


    Hi, I have a post and when I try to create a form for the frontend all the fields are shown except the featured image. If I don’t pass the fields by parameter and let all the fields be shown, the featured image field is shown. This is my code:

    $fields = array( ‘post_title’ => array(‘label’ => ‘Full name’), ‘featured_image’, ‘ambassador_innovators’, ‘org_practice_innovators’, ‘country_innovators’, ‘sustainability_innovators’, ‘area_innovators’, ‘rural_context_innovators’ );

    $innovator = pods( ‘innovator’ );

    echo $innovator->form($fields,’Add’);

    What could be the problem?

    • This topic was modified 5 months, 3 weeks ago by ominem.
Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Contributor Scott Kingsley Clark

    (@sc0ttkclark)

    I’ll take a look at this and see what’s up.

    Thread Starter ominem

    (@ominem)

    Thanks.
    Also if it helps I have a file upload field and when I change the “File Uploader” option to?“Upload only” the field doesn’t show anymore in the “Edit Pod Template -> Available magic tags“. However it still works fine and shows the data

    • This reply was modified 5 months, 2 weeks ago by ominem.
    • This reply was modified 5 months, 2 weeks ago by ominem.
    Plugin Support Paul Clark

    (@pdclark)

    The meta key for Featured Image is _thumbnail_id.

    The simplest similar form code, where the post type is post, would be:

    <?php
    echo pods( 'post' )->form(
    	[
    		'post_title' => [ 'label' => 'Full name' ],
    		'_thumbnail_id',
    	],
    	'Add'
    );

    …where the critical change is _thumbnail_id instead of featured_image.

    Thread Starter ominem

    (@ominem)

    Ok, thank you for the quick answer.

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