Employees widget

Hi,

I need to add fields “Mobile”, “Email” and “LinkedIn” to the employees widget. I do understand that for now only available fields are Facebook, Twitter and Google+, my question is where in the code I can change their values (names?)

Regards,
JS

Hello there,

Thank you for asking.

To edit the input fields, go to Dashboard > Types > Custom Fields > Employee Info

To edit the frontend output, edit widgets/fp-employees.php file

Regards,
Kharis

Hi,

so I’ve edited fields via ‘Types’, just like you suggested, but it doesn’t work.

Fields look like this: http://s17.postimg.org/cqw5k17en/image.png

And in the employee widget fields are like that: http://s11.postimg.org/i3s0zfojn/image.png

But they are not visible on page.

Hello there,

I guess you have not printed the new filed values, yet.

  1. Edit widgets/fp-employees.php file
  2. Find this code block, then replace to this

If it didn’t work, you should adjust the slug of your fields.

Regards,
Kharis

Thank you for answer,

I’ve edited fp-employees.php file but without any luck…

Slugs are just like in the code you’ve provided:

mobile
email
linkedin

Hello there,

Thank you for updating me.

Try to change the following lines

  $mobile   = get_post_meta( get_the_ID(), 'mobile', true );
  $linkedin = get_post_meta( get_the_ID(), 'linkedin', true );

to

  $mobile   = get_post_meta( get_the_ID(), 'wpcf-mobile', true );
  $linkedin = get_post_meta( get_the_ID(), 'wpcf-linkedin', true );

Let me know how it goes.

Regards,
Kharis

We are almost home :slight_smile: I have a problem with ‘email’ field. I’ve wrote a ‘code’ based on one which you have provided in last post, however it still ads “http://” in front of email adress (it looks like this: http://aowoc@bpsc.com.pl)

The code is:

http://s14.postimg.org/bctyb6bzl/Przechwytywanie.png

Could you confirm if you have set your email field with an “email” field (Types > Custom Fields > Employee Info)?

Regards,
Kharis

I believe I can confirm - > http://s22.postimg.org/sd0izwl7l/Przechwytywanie.png

Hello there,

Thank you for confirming.

What’s the field value in the “Employee info” box in the Employee editing panel? Could you confirm if it has no http://?

Regards,
Kharis

No, it has not http://s14.postimg.org/kefkdv2wx/Przechwytywanie.png

Could you please try change the following as seen here?

esc_url($email);

to

esc_html($email);

Let me know how it goes.

Regards,
Kharis

Without any luck… Now I have this http://s10.postimg.org/og9p27it5/Fire_Shot_Screen_Capture_034_404_Not_Found.png when I click on the envelope (mail).

Hello there,

Thank you for updating me.

Could you please give me a temporary access to your site admin area and FTP account so I can have a closer look and might be able to provide a fix from there? Please send the login credentials to my email kharisblank at gmail dotcom with the link to this topic.

Regards,
Kharis

Login credentials along with WP Account user have been sent to your mail.

Regards,

JS