Shortcodes Overview
ForumWP comes with several shortcodes that can be used to insert content inside posts and pages.
Page Shortcodes
- [fmwp_login_form /] - shows the login page
- [fmwp_registration_form /] - shows the registration page
- [fmwp_user_profile /] - shows the user profile page
- [fmwp_forums /] - shows the forums page
- [fmwp_topics /] - shows the topics page
- [fmwp_new_forum /] - shows the new forum page
In most cases, these shortcodes will be added to pages via a click on the "Create Pages" button in our wp-admin notice and do not need to be used manually.
Single post shortcodes
-
[fmwp_forum /] - Single Forum. You could insert a single forum content anywhere at your site's pages. There are a few arguments for setting the single forum shortcode:
- id - shows the Forum with this ID. If id="" - the shortcode shows empty content.
-
order - shows the forum's topics in this order. There are the next values of the {order_type} argument:
- date_desc - Newest to Oldest;
- date_asc - Oldest to Newest;
- update_desc - Recently updated;
- views_desc - Most views;
- replies_desc - Most replies;
- likes_desc - Most likes (Likes module);
- votes_desc - Most votes (Votes module);
- show_header - you could show forum information above the forum's topics list, please set to "yes". By default, it's "no".
-
[fmwp_topic /] - Single Topic. You could insert a single topic content anywhere at your site's pages. There are a few arguments for setting the single topic shortcode:
- id - shows the Topic with this ID. If id="" - the shortcode shows empty content.
-
order - shows the topic's replies in this order. There are the next values of the {order_type} argument:
- date_desc - Newest to Oldest;
- date_asc - Oldest to Newest;
- likes_desc - Most likes (Likes module);
- votes_desc - Most votes (Votes module);
- show_forum - you could show forum title below each topic, please set this attribute to "yes". It's "yes" by default and uses the option in ForumWP > Settings > General > Topics > Show Forum Title.
- show_header - you could show topic information above the topic's replies list, please set to "yes". By default, it's "no".
Login Form shortcode
You could insert a login form shortcode anywhere at your site's pages. There are a few arguments for setting the login form options:
- is_popup - you could show login form in a modal window, please set this attribute to "1". By default, it's "0".
- redirect - you could redirect the logged in user to the selected page, please set the URL here. It's empty by default and uses the option below. Important!: The login form in the modal window will redirect the user after login to the same page.
$_GET['redirect_to']
attribute in the URL has more priority for all no-modal login forms. So the user will be redirected to the URL, which you set in $_GET attribute. (https://forumwp.g-photo.com.ua/login/?redirect_to=https://forumwp.g-photo.com.ua/profile/
link will redirect tohttps://forumwp.g-photo.com.ua/profile/
after a user logs in)
Registration Form shortcode
You could insert a registration form shortcode anywhere at your site's pages. There are a few arguments for setting the registration form options:
- first_name - you could hide the "First Name" field in the form, please set this attribute to "hide". By default, it's "show".
- last_name - you could hide the "Last Name" field in the form, please set this attribute to "hide". By default, it's "show".
- redirect - you could redirect the successfully registered user to the selected page, please set the URL here. It's empty by default and uses the option below.
User Profile shortcodes
You could use [fmwp_user_profile /]
shortcode to display the user profile anywhere at your site's pages. If you use this shortcode at the page, which wasn't set as the "User Profile" page below. You will see the current logged in user's profile. Otherwise, user data is taken from the permalink.
You could use the following shortcodes to display parts of the user profile page anywhere at your site for the selected user:
- [fmwp_user_topics user_id="{UserID here}"] - shows the topics of the {UserID} user. It means the {UserID} user is an author of those topics.
- [fmwp_user_replies user_id="{UserID here}"] - shows the replies of the {UserID} user. It means the {UserID} user is an author of those replies.
- [fmwp_user_bookmarks user_id="{UserID here}" tab="topics|replies"] - shows the bookmarked topics/replies of the {UserID} user.
- [fmwp_user_likes user_id="{UserID here}" tab="topics|replies"] - shows the liked topics/replies of the {UserID} user.
- [fmwp_user_subscriptions user_id="{UserID here}" tab="topics|forums"] - shows the subscribed forums/topics of the {UserID} user.
- [fmwp_user_edit /] - shows the "Edit Profile" form for the current logged in user.
Forums List shortcode
You could insert a forums list shortcode anywhere at your site's pages. There are a few arguments for setting the forums list options:
- search - you could hide the search bar above the forums list, please set this attribute to "no". By default, it's "yes".
- new_forum - you could show the "New Forum" button above the forums list, please set this attribute to "yes". By default, it's "no".
- category - you could show the forums of the selected category, please set this attribute to "{categoryID}". By default it's "". The necessary value you could get in the "Category ID" column
- with_sub - Whether or not to include children forum categories. Defaults to "1" - yes, set "0" for no.
- order - you could show forums in a custom order you may set this argument to "{order_type}". By default, it's default forums order, which is set in the option below.
There are the next values of the {order_type} argument:
- date_desc - Newest to Oldest;
- date_asc - Oldest to Newest;
- order_desc - Most Priority;
- order_asc - Lower Priority;
Topics List shortcode
You could insert a topics list shortcode anywhere at your site's pages. There are a few arguments for setting the topics list options:
- search - you could hide the search bar above the topics list, please set this attribute to "no". By default, it's "yes".
- new_topic - you could hide the "New Topic" button above the topics list, please set this attribute to "no". By default, it's "yes".
- show_forum - you could show forum title below each topic, please set this attribute to "yes". It's "yes" by default and uses the option below.
- tag - you could show the topics of the selected tag, please set this attribute to "{tagID}". By default it's "". The necessary value you could get in the "Tag ID" column.
-
status - you could show topics with necessary status, please set this attribute to "{status_type}". By default it's "" and show all available for the current user statuses of topics.
There are the next values of the {status_type} argument:
- open - published topics;
- pending - pending topics;
- trash - topics in trash;
- spam - spam topics;
- locked - locked topics;
-
type - you could show topics with necessary type, please set this attribute to "{topic_type}". By default it's "" and show all topics' types.
There are the next values of the {topic_type} argument:
- normal - Normal topics;
- pinned - Pinned topics;
- announcement - Announcement topics;
- global - Global topics;
- order - you could show topics in a custom order you may set this argument to "{order_type}". By default, it's default topics order, which is set in the option below.
There are the next values of the {order_type} argument:
- date_desc - Newest to Oldest;
- date_asc - Oldest to Newest;
- update_desc - Recently updated;
- views_desc - Most views;
- replies_desc - Most replies;
- likes_desc - Most likes (Likes module);
- votes_desc - Most votes (Votes module);
Troubleshooting Shortcodes
If you correctly pasted your shortcodes and the display looks incorrect, make sure you did not embed the shortcode between <pre>
tags. This is a common issue. To remove these tags, edit the page, and click the Text tab: