Home Forums Plugin Support WP User Frontend Pro Add classes to custom fields in post

This topic is: not resolved

This topic contains 10 replies, has 2 voices, and was last updated by  towhid 3 years, 10 months ago.

Viewing 11 posts - 1 through 11 (of 11 total)
  • Author
    Posts
  • #45944

    Boris
    Member
    Post count: 10

    Hi,
    I've just purchased your plugin and am now in the process of setting it up for my website. I've created a form built up entirely of custom fields, which will generate a post. The goal is that members will receive an account, log in, fill out the form, and a post with their “profile” is created.
    I have added a class to each custom field. This works fine in the form itself, but the classes are not generated for the eventual post. It's just a UL with lots of LI items, none of which are given a class.
    There are two things I would like to know:
    – How can I add classes to the content of each custom field in the eventual post?
    – I would like to wrap combinations of some of the custom field content within a div as well. For instance custom fields 2 and 3 are wrapped within one div, custom fields 9,10 and 11 are also wrapped within one div. I tried by adding HTML custom fields, but since each custom field is generated within a list item, this does not work. How can I accomplish this?
    Thanks for the help!
    Regards,
    Boris Hoekmeijer

    #45973

    towhid
    Participant
    Post count: 4505

    Hello Boris,

    I am not clear your question. Can you please make the question elaborate more. It will be good if you send me screenshot and code.

    This will help me to attain a solution.

    Thanks

    #45991

    Boris
    Member
    Post count: 10

    Hello Towhid,
    thanks for your help!. Ok. I include four screenshots and some code:

    1. Consultant form backend
    consultant-form-backend.png
    2. Consultant form frontend
    consultant-form-front-end.png
    3. Consultant post backend
    consultant-post-backend.png
    4.Consultant post frontend
    consultant-post-frontend-without-classes.png

    As you can see, I added classes to all of the custom fields in the back-end of the form (img 1). The classes work fine in the form on the front end (img 2), as you can see, I've made a lay-out using CSS there.

    For the post that is generated with the form: You can see the backend (post edit, img 3), and the front-end (img 4). As you can see, the information is all there. But since the custom fields are generated as list items with no classes attached to them, I cannot do any styling with CSS. You can see the code of the post below. I want classes added to the list items on the post, so I can style them. Without that, the custom fields are useless. Is this more clear?

    				<article id="post-202" class="post-202 post type-post status-publish format-standard has-post-thumbnail hentry category-consultants category-designer tag-mvp tag-playmaker tag-shooter">
    
    						<!-- post title -->
    						<h1>
    							<a href="http://www.mars-proface.com/consultants/steph-curry/" title="Steph Curry">Steph Curry</a>
    						</h1>
    						<!-- /post title -->
    
    						<!-- post thumbnail -->
    													<a href="http://www.mars-proface.com/consultants/steph-curry/" title="Steph Curry">
    								<img src="http://www.mars-proface.com/wp-content/uploads/2015/06/steph-curry1.png" class="attachment-post-thumbnail wp-post-image" alt="steph-curry" />							</a>
    												<!-- /post thumbnail -->
    
    			
    						<ul class="wpuf_customs"><li><label>COMPANY LOGO:</label> <a href="http://www.mars-proface.com/wp-content/uploads/2015/06/Dorfl-logo-FINAL.jpg"><img width="150" height="150" src="http://www.mars-proface.com/wp-content/uploads/2015/06/Dorfl-logo-FINAL-150x150.jpg" class="attachment-thumbnail" alt="Dorfl-logo-FINAL" /></a> </li><li><label>RESUME:</label> <a href="http://www.mars-proface.com/wp-content/uploads/2015/06/Lijst-van-HTML-kleuren.pdf">Lijst van HTML-kleuren</a> </li><li><label>COMPANY NAME</label>: GS Warriors</li><li><label>AVAILABILITY</label>: Currently available</li><li><label>INTRODUCTION</label>: introductieverhaal, verzin maar iets.</li><li><label>EXPERIENCE</label>: wanadoo| online| golden state</li><li><label>EXPERTISE AREAS</label>: ast/to ratio| 3-point shooting</li><li><label>PHONE</label>: 0647847723</li><li><label>EMAIL  ADDRESS</label>: <a href="mailto:boris@ispace.nu">boris@ispace.nu</a></li><li><label>WEBSITE</label>: <a href="http://www.gs.com" rel="nofollow">http://www.gs.com</a></li><li><label>KvK</label>: 123558453</li></ul>
    						Tags : <a href="http://www.mars-proface.com/tag/mvp/" rel="tag">mvp</a>, <a href="http://www.mars-proface.com/tag/playmaker/" rel="tag">playmaker</a>, <a href="http://www.mars-proface.com/tag/shooter/" rel="tag">shooter</a><br>
    						<a class="post-edit-link" href="http://www.mars-proface.com/edit/?pid=202&_wpnonce=1d475afbbc">Edit This</a>
    
    					<div id="edit-wrap">
    						<div id="cons-edit">
    							<span class="icon-pencil"><a class="post-edit-link" href="http://www.mars-proface.com/edit/?pid=202&_wpnonce=1d475afbbc">Edit my profile</a></span>						</div>
    					</div>
    
    				</article>
    
    #46095

    Boris
    Member
    Post count: 10

    Hello Towhid,
    I need to have this issue fixed as soon as I can. Have you taken a look at it?

    Perhaps you can make an updated plugin version with the generated post list items containing dynamic class names, or tell me where in the code I should add that.

    Please let me know.
    Regards,
    Boris Hoekmeijer

    #46101

    towhid
    Participant
    Post count: 4505

    Hello Boris,

    You can add the class for frontend post form, but not submitted a post.

    Please, open wp-user-frontend/wpuf-functions.php and find below the line, where you need to customization code.

    $value = get_post_meta( $post->ID, $attr['name'] );
    
                    $new = implode( ', ', $value );
    
                    if( $new ) {
                        $html .= sprintf( '<li><label>%s</label>: %s</li>', $attr['label'], make_clickable( $new ) );
                    }

    To attain that feature you need to customize by yourself or you can hire a developer.

    Thanks

    #46123

    Boris
    Member
    Post count: 10

    Hello Towhid,

    are you serious? What is the point of this plugin if you cannot style the posts it generates? Can you at least tell me where I could add the classes to the custom fields of the post? Why is this so difficult?

    #46148

    Boris
    Member
    Post count: 10

    I found in wpuf-functions.php where to add the classes. Can you tell me how I can add a dynamic class with the custom field name to the list item on line 660? You do the same for the back-end form, so I assume it is not that difficult?

    #46152

    Boris
    Member
    Post count: 10

    I just managed to make it work ok by adding a li class called %1$s. This adds the custom field's name as a class. Not the most elegant solution, but it works. Since it is so simple, I can't help but wonder why you did not build in this kind of basic functionality that everyone using the plugin to create posts would need.
    Even better would be that the class you can enter in the form editor is also applied to the items on the post.
    Can you add this functionality to the plugin?

    #46183

    Boris
    Member
    Post count: 10

    Hello,
    I am starting to feel very unhappy about the support I receive for a paid plugin! Most free plugin builders give better support (and communication!) than this. You built a very good plugin, but it is lacking a bit in usability for the frontend. I am trying to give you some solid feedback so you can improve your plugin, and asking for help, but in response I get no communication other than a standard answer.
    I have quite a large network of webdesigners around me, and I am sure you would not want a bad reputation to start spreading. So do what you promise, and give me some proper support. A happy customer is a returning customer.

    #46202

    Boris
    Member
    Post count: 10

    You might have told me this page exists: http://docs.wedevs.com/showing-meta-fields-in-frontend/, I've got it solved now.
    I cannot say I am very impressed by your service level!

    #46256

    towhid
    Participant
    Post count: 4505

    Hello Boris,

    Sorry for my inconvenience. Actually we are not available on Friday. Because Friday here is our weekend. You know, I had maintained communication throughout the day on Thursday. But as Thursday was our last day of office so you had missed my support on Friday.

    If I maintain communication throughout the day in Friday than I can say I could understand your question clearly( on the basis of uninterrupted communication) and you would never get an ordinary answer from me.

    I am really happy to know that you have solved the problem on yourself.

    If you need any other help for me I am here to help you.

    Thank you ๐Ÿ™‚

Viewing 11 posts - 1 through 11 (of 11 total)

The topic ‘Add classes to custom fields in post’ is closed to new replies.