Home Forums Plugin Support WP User Frontend Pro Hiding field labels

This topic is: resolved

This topic contains 12 replies, has 2 voices, and was last updated by  John 4 years, 10 months ago.

Viewing 13 posts - 1 through 13 (of 13 total)
  • Author
    Posts
  • #20882

    John
    Member
    Post count: 63

    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.

    #20886

    Oritro Ahmed
    Spectator
    Post count: 155

    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?

    #20894

    John
    Member
    Post count: 63

    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.

    #20895

    John
    Member
    Post count: 63
    #20901

    Oritro Ahmed
    Spectator
    Post count: 155

    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.

    #20910

    John
    Member
    Post count: 63

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

    #20911

    Oritro Ahmed
    Spectator
    Post count: 155

    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 !

    #20954

    John
    Member
    Post count: 63

    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.

    #21003

    Oritro Ahmed
    Spectator
    Post count: 155

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

    #21048

    John
    Member
    Post count: 63

    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?

    #21124

    Oritro Ahmed
    Spectator
    Post count: 155

    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.

    #21130

    John
    Member
    Post count: 63

    Many thanks!

    #23070

    John
    Member
    Post count: 63

    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 13 posts - 1 through 13 (of 13 total)

The topic ‘Hiding field labels’ is closed to new replies.