Forums

Custom Field Template
Multiple images and urls broken, php errors - Custom Field Template (3 posts)

  1. dencreativeltd
    Member
    Posted 11 months ago #

    Hi there, I have the following template setup in the settings for a particular category of post -

    [Feature Slideshow Image]
    type = file
    
    [Feature Images]
    type = file
    label = Feature Imagesz
    multiple = true
    multipleButton = true
    
    [Feature Video]
    type = file

    When i look at the post it is fine, but after I have uploaded an image firstly it fills in the custom field below with a number - not an image, what does this refer to? how can i show this in a php temnplate?

    Also, if I( refresh the page I get the following errors.

    Notice: Undefined index: feature_images in /EXAMPLE.COM/wp-content/plugins/custom-field-template/custom-field-template.php on line 2944
    
    Notice: Undefined index: feature_images in /EXAMPLE.COM/wp-content/plugins/custom-field-template/custom-field-template.php on line 2944
    
    Notice: Undefined index: 12566 in /EXAMPLE.COM/wp-content/plugins/custom-field-template/custom-field-template.php on line 2123
    
    Notice: Undefined index: cft_mode in /EXAMPLE.COM/wp-content/plugins/custom-field-template/custom-field-template.php on line 2123

    Is this something I'm doing wrong or is there actually an error?

  2. proximity2008
    Member
    Posted 11 months ago #

    1) http://codex.wordpress.org/Function_Reference/get_post_meta
    The name of your fields are between the parentheses [field].

    2) Turn off warnings and notices:

    http://www.wordimpressed.com/wordpress/php-turn-on-or-off-error-reporting/

  3. dencreativeltd
    Member
    Posted 11 months ago #

    Turning off the notices obviously doesn't fix the issues.

    And as mentioned, i can fill in the custom field in the template - but it fills it with a number i.e. 23654 rather than the url to the image, this means i cant put it directly in the src= tag of the <img>.

    This comes back to the fact that when I select the image in the file selector it is saving a number rather than the url. Does this refer to a separate database because it is a multiple file upload?

    If so - do I need to create an array to fetch this?

    Cheers

Reply

You must log in to post.

About this Plugin

About this Topic