Shortcode to create tabbed account area for Easy Digital Downloads and AffiliateWP
Create a one-page account area with relevant sections separated by tabs. Include purchase history, license keys, user profile editor, and more all with one easy to use shortcode.
If a user is not logged in they will automatically be shown the EDD Login form.
Include the following content in your user’s account area:
** Requires additional or add-on plugins
Search for Tabbed Account Area in the WordPress.org plugin directory. Install and activate the plugin.
No settings are required for this plugin.
The plugin creates a shortcode [account_tabs]
, which can be inserted into any page on your site where you would like your customers to access their account information.
The shortcode has a number of attributes you can use to customize the output of these tabs. Tabs will be displayed in the order that you include these attributes:
For each attribute, you can assign a title, which will be used for the tab’s name. For example, the following shortcode would display your customer’s purchase history and profile editor:
[account_tabs purchase_history=”Purchase History” edd_profile_editor=”Edit Your Profile”]
The tabs would have the text “Purchase History” and “Edit Your Profile” respectively. When the customer clicks on either tab, the appropriate content would be displayed.
The plugin comes with three style options.
There is also the possibility to use custom CSS to style your tabs.
You would indicate the style you wish to use by including the style attribute in the shortcode with the appropriate position:
If you choose to use the custom style option, you will need to add a file to your theme.
Add a file called taa.css to the css folder in your current theme or child theme. If no css folder exists, you can create one for this purpose.
/wp-content/themes/your-theme/css/taa.css
In your AffiliateWP settings, make sure that the Affiliate Area page is the same as the page that includes the [account_tabs] shortcode.
Also, if you are including the style attribute in the shortcode, make sure that it is listed after the affiliate_area attribute.
The tabs will be listed in the order you have the respective attributes in the shortcode.
For example, [account_tabs purchase_history=”Purchase History” edd_profile_editor=”Edit Your Profile”] will have Purchase History first, and Edit Your Profile second. [account_tabs edd_profile_editor=”Edit Your Profile” purchase_history=”Purchase History”] will have Edit Your Profile first, and Purchase History second.
[hidden_content]
shortcode.