Hiding field labels

This topic contains 12 reply and 2 voices, and was last updated by John 9 years, 9 months ago
Viewing 12 Posts - 1 through 12 (of 12 total)
Author Posts
May 23, 2014 at 8:15 pm 20882
John I've created some custom fields and have "custom fields on post content area" enabled in settings so they display on the single posts (single.php) etc. This displays both the Filed Label and any content entered into the field. Is it possible to suppress (hide) the Field Labels from displaying in the backend? I don't want the bullet point and Field Name to show. For example, my images are accompanied by unnecessary • Image 1:, • Image 2:, • Image 3: field labels etc. I know this could be done by editing meta keys into the single.php code, but this seems unnecessarily awkward and complicated. I tried deleting the Field Labels in my forms, just entering meta key names. This almost works but the bullet point and colon (•:) still show.
May 23, 2014 at 9:36 pm 20886
Oritro Ahmed Oritro Ahmed

Hello John, Can you Show was a Live Version? Your Problem can be solved in two ways. Before heading over there, We need to see a live version of a sample page. Can you do that?

May 24, 2014 at 12:32 am 20894
John John

Hi Ahmed,

Thanks for your response.
Here’s a test page: http://pennymachines.co.uk/museum-allwins-1/
The first few posts demonstrate the issue.

May 24, 2014 at 1:05 am 20895
John John

The forms are here:
http://pennymachines.co.uk/museum-allwins-1/posting-in-the-museum/
http://pennymachines.co.uk/museum-allwins-1/put-an-allwin-in-the-museum/

May 24, 2014 at 2:27 am 20901
Oritro Ahmed Oritro Ahmed

Hello john, For starter,

ul.wpuf_customs {
list-style: none !important;
}

Put this code in your theme’s style.css file. It will hide the Bullets from the Fields.

May 24, 2014 at 3:44 am 20910
John John

OK thanks – I’ve implemented that.
Can you suggest how to hide some/all of the Field Labels?

May 24, 2014 at 4:17 am 20911
Oritro Ahmed Oritro Ahmed

There is a Slight Problem john.

All the Field Labels Comes in a single <lable></lable> tag. Only thing we can do here is removing the hole label tag. I am giving you a Quick CSS Solve. Please try it, If you find it not quite what you are looking for, Erase the code.

.wpuf_customs label {
display: none !important;
}

It will hide the Custom Fields names !

May 25, 2014 at 1:12 am 20954
John John

OK thanks – like the method I tried before (deleting the Field Labels in my forms and just entering meta key names) that almost hides the Field Labels. Unfortunately, the colons (:) still display.

I think there’s a design problem here which needs addressing. Currently the Field Labels displayed on the form have to be identical to those displayed on the submitted post. This is not always going to be ideal. In the case of images, for example, no field labels are required in the post – the visitor can see they are images, so field labels are superfluous. Likewise, the exact wording of field labels I want to show on the forms tend to be slightly different to what I want visitors to see on the submitted page.

May 25, 2014 at 3:39 pm 21003
Oritro Ahmed Oritro Ahmed

Nice Idea John. I will let the Developer Team know about it.

May 26, 2014 at 10:00 pm 21048
John John

Thanks – that would be good. I look forward to any progress on it.

Meantime, can you tell me which file I would need to edit to remove the colon?

May 28, 2014 at 3:25 pm 21124
Oritro Ahmed Oritro Ahmed

Hello John,

Sorry for a Little late. To Remove the Colon, you have to a little bit modification. Open the wpuf-functions.php file which is located in WPROOT/wp-content/plugins/wp-user-frontend-pro/ and go to line 660. You will see a code like this there,

$html .= sprintf( '<li><label>%s</label>: %s</li>', $attr['label'], make_clickable( implode( ', ', $value ) ) );

Just remove the colon from here, <li><label>%s</label>: %s</li>, It should do it.

May 28, 2014 at 6:37 pm 21130
John John

Many thanks!

July 7, 2014 at 1:24 am 23070
John John

Just a footnote – hiding the field names in the posted content with CSS is not an entirely satisfactory solution because the text is still indexed in searches. The internal WordPress site search shows all these extraneous words around the content you actually want it to display.

The only solution I know at present is to leave the Field Labels empty (entering only Meta Keys) and use the Help Text field to indicate what each field is for. Clearly not ideal. I’m hoping in the next version of Frontend there will be pairs of Field Name fields – one for the form, and another for the submitted post (to be left blank or otherwise).

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