Tag Archives: widgets

How To Display Custom Fields in Widgets

Displaying custom fields in widgets is very easy and it can be done by using the Custom Profile Fields shortcode.

The following shortcode can be used to display custom fields in your custom page templates.

[usersultra_user_custom_meta_info fields_list='first_name:First Name,last_name: Last Name' within_widget='yes']

Using the Custom Profile Fields shortcode in Widgets:

1 – Click on Appearance & Customization – Widgets & Modules.

step1

By default the new widget is added in the Unavailable Widgets section and you have to drag&drop it in the Available Widgets Area.

step2

Once you have dragged and dropped the widget you have to click on the “Apply layout” button. This is important, otherwise the front end users profile won’t display the new widget.

step3

Click on one of your user’s profile and you will see the following widget:

step4

How To Activate & Deactivate Modules

Removing or adding widgets in the user’s profile is really easy and it can be done by using the drag&drop widgets customizing tool which is in the Widgets tab.

Click on Appearance & Customization tab – Widgets.
1

Then you will see the following screen:

2

Just drag&drop the widgets between the two sections. If you wish to disable a widget just drag it to the Unavailable Widgets Section. If you wish to activate it again just drag it and drop it in the Available Widgets Section.

Custom Profile Fields

[usersultra_user_custom_meta_info]

This Shortcode displays custom user’s meta information. You can use this shortcode to display custom fields from the users.

Options:

OPTIONS DEFAULT ALTERNATIVES
user_id Current Logged in User ID Any user ID
fields_list NULL any meta field separated by commas. Examples: first_name:First Name
within_widget no “yes” or “no”. Set it to “yes” when using this shortcode within the profile widgets.
template table table, block, simple

Special meta keys:
user_nicename
user_email
user_registered
display_name
first_name
last_name
ID

Example:

			
[usersultra_user_custom_meta_info user_id='157' fields_list='first_name:First Name, last_name:Last Name']

Example 2:

Within a widdget. This example can be used in the User’s Widgets administrator.

[usersultra_user_custom_meta_info fields_list='first_name:First Name,last_name: Last Name, facebook:Facebook, twitter:Twitter, googleplus:Google' within_widget='yes']