• Resolved ElectroMagnetic

    (@electromagnetic)


    Hello.
    How can I put description text below my field’s label ?

    I’m battling to get your solution above in the FAQ’s to work for me.

    I tried your script and worked! but only in the Base Group Profile ( required field for registration)
    But it does not reflect in my rather lengthly extended profile Groups or Fields.
    I did copy the register.php in the correct hierarchy of folders to my child theme and you script did work…but as said above.
    even tried it the member/single/profile/edit.php
    Not sure where to go from here
    Could I please ask for your assistance here.

    https://wordpress.org/plugins/buddypress-xprofile-custom-fields-type/

Viewing 9 replies - 1 through 9 (of 9 total)
  • Thread Starter ElectroMagnetic

    (@electromagnetic)

    Sorry I forgot to mention above…

    I even tried to move the

    <p class=”description”><?php bp_the_profile_field_description(); ?></p>

    further up in the edit.php and can get the description to move only above the field label….not below the label
    I tried about 8 different locations in the file…its’ either above the field label or below the checkbox/text fields

    Plugin Author Miguel López

    (@atallos)

    The solution I put in the FAQ is very dependent of html code, so probably the other groups of fields are different. Send me a link yo see it and I try to check it when I have time if you want.

    Thread Starter ElectroMagnetic

    (@electromagnetic)

    Hi Donmik
    Thank you for getting back to me.
    The site is thegiftvillage(dot)com and you would need to login with this dummy profile
    Username : electromagnetic
    password : dV&%%3%rMS7&2%

    The site is still in production so has not been set to index with the search engines yet.

    If you get the time I would really appreciate it, thank you

    ps: sorry about the password…it’s just habit!

    Plugin Author Miguel López

    (@atallos)

    Hi,

    Put the javascript in edit.php or where you need it. I can’t see it in html code. I revised edit profile form and other group fields. It should work so maybe it’s a javascript error.

    Thread Starter ElectroMagnetic

    (@electromagnetic)

    Hey Donmik
    Somethings working, have a look here

    http://awesomescreenshot.com/0d33odtz8b

    I added the javascript to the edit.php at the bottom of the file ( I’m not sure if this is the place to put it)… before the last two statements

    ‘<?php endwhile; endif; ?>
    <?php do_action( ‘bp_after_profile_edit_content’ ); ?>’

    Now the description is below the field label for “text” input fields….but the “checkbox” fields repeat the description and still have it at the end of the field.

    I’m really excited this is coming together…is there a js fix for this?
    thank you for you’re input

    Plugin Author Miguel López

    (@atallos)

    Try this:

    jQuery('p.description').each(function() {
        // Clone description.
        // Looking for parent div.
        // Looking for label of checkbox field or radio field first.
        var desc = jQuery(this).clone(),
            parent = jQuery(this).parent(),
            label = parent.find('span.label');
        // If there is no label of checkbox field or radio field, we look for normal labels.
        if (!label.length) {
            label = parent.find('label:first');
        }
        // If there is a label.
        if (label.length) {
            // Putting the description after the label.
            label.after(desc);
            // Removing the original description.
            jQuery(this).remove();
        }
    });

    I’ve changed this line
    label = parent.find(‘label:first’);
    This will take only the first label instead of all labels.

    You can add javascript at the bottom of file, no problem.

    Thread Starter ElectroMagnetic

    (@electromagnetic)

    Hi Donmik
    🙂 this seems to have done the trick!!!! see image link

    http://awesomescreenshot.com/0133oh0bc3

    I wrapped your code in <script> </script>…not sure if that’s redundant

    I can’t thank you enough for the assistance you provided. I have battled with this issue for some time now….thank you.

    Plugin Author Miguel López

    (@atallos)

    Great!

    Yes, you need to wrap it with <script> tag.

    You’re welcome!

    Thread Starter ElectroMagnetic

    (@electromagnetic)

    🙂 thank’s

Viewing 9 replies - 1 through 9 (of 9 total)
  • The topic ‘field description below label in profile’ is closed to new replies.