Form or Fields in a Template?

This topic contains 4 reply and 2 voices, and was last updated by Tareq Hasan 10 years, 6 months ago
Viewing 4 Posts - 1 through 4 (of 4 total)
Author Posts
October 27, 2013 at 3:13 am 9474
Tareq Hasan Is it possible to call a form or individual fields from a template? Basically I'd like to have simple PHP functions to call rather then the short code for WP. Thanks, -JRW
October 28, 2013 at 2:13 am 9489
Tareq Hasan Tareq Hasan

It’s very simple to output custom fields in your theme. Open single.php and you can use the code like this:
[php]
<?php
if ( $office = get_post_meta( $post->ID, ‘office_meta_key’, true ) ) {
echo $office;
}
?>[/php]

As an example, we are using a meta key named office_meta_key and if it has any value, we print it.

October 28, 2013 at 7:54 pm 9505
Jonthan Jonthan

Thanks, but that’s not exactly what I was looking for… I have been able to output the data from a form already.

I was looking to output the actual form… or more importantly, individual fields from a form to a template.

I trying to work around some limitation of this plugin. Many of us need more control over the form fields then you currently offer. I am still having an issue with the image upload field not restricting the number of images uploaded. I also need to find a way to limit the number of characters put into a form field and the type of characters put into a form field.

So far the only two possibilities that I have found are:

1) Just filter the form data and display what I want. That’s fine, but if a user inputs 500 characters of data into a field and sees 10 characters displayed, they won’t be too happy and will probably leave. It would be better if they were limited during the input stage of the process.

2) You have posted some jquery/javascript code on here.

http://stackoverflow.com/questions/2805678/limit-number-of-characters-entered-in-textarea/2805726#

http://stackoverflow.com/questions/12410868/jquery-limit-text-in-input-box

I’m trying to figure out the best way to try implementing these.

Again, I really think this is one of the best wordpress plugins available but there are some small omissions which really kill is usability on many sites.

Thanks for your help.

-JRW

October 29, 2013 at 3:47 am 9537
Jonthan Jonthan

Anyone?

-JRW

October 29, 2013 at 4:00 am 9538
Tareq Hasan Tareq Hasan

Does the limitation of file upload in the form doesn’t work for you?

Also wrote a tutorial about limiting the text input in the field, hope that helps.

Viewing 4 Posts - 1 through 4 (of 4 total)