This is an example of how to create a Links Library page for your website with a front end form for visitors to submit their own link for consideration. Utilizing the following plugins: Gravity Forms, Custom Post Type UI, Advanced Custom Fields, and Gravity Forms + Custom Post Types.

First step is to install all of the plugins.  Next step is to go into the CPT UI and add a new custom post type to your system.  In this example we want to create a links_library custom post type.  So set links_library as the Post Type Name, Links Library as the Label so it is different than the regular Links post type inherent in the WordPress system, and Link as the Singular Name.  Set the description to what you like so that it can be descriptive enough for what this post type is.

Next you want to select Advanced Options and customize what is supported by the custom post type.  All the other settings can remain the default but for this example all we need is the post title and post content so leave the Title and Editor checked off and deselect the other options under the Supports section.

Now you want to click the Create Custom Post Type button to finalize its creation. You will see a “Custom post type created successfully. You may need to refresh to view the new post type in the admin menu.” message showing that your new Links Library Custom Post Type has been created. Now we want to add the Link URL capability to this custom post type.  So now we want to go into the Custom Fields menu and choose Add New to create a new Field Group.  Name it Library Link and then under Location set the Show this field group if Post Type is equal to links_library.

Next you want to add a new field to this group by clicking the +Add Field button. Enter in Field Label the label Link URL.  Field name will automatically be updated with link_url.  Field Type can be left as text and then click the Publish button.

Next we want to start creating the form within Gravity Forms.  So go into Gravity Forms and click the Add New button to start creating the form.  In the Form Title section type in Add to Links Library.  Once editing the form on the right hand side you can expand the Post Fields section.
Three of the types of fields we want to use are in this section.  Title allows us to set the post title for the link, Body allows us to set the post content, and Custom Field allows us to add the Link URL.  So click on Title, Body, and Custom Field to add one of each to the form.  Then under the Advanced Fields group we want to add the Captcha choice.  So now we have four fields to edit within this form.

Now we will go through the configuration for each of the fields.

The first field is the Title field.  For the Field Label we want to enter in Link Title. Under Post Status we want to choose Pending Review.  For the Default Author we can uncheck the check box stating Used logged in user as author.  Under Rules you will also see a check box to make this a Required field, so check that off.


Now go into the Advanced tab.  We want to check off the Save As Post Type box and select Links Library as the Post Type.
LinkTitleAdvancedNext we can go onto the second field of the form, the Post Body field.  Change the Field Label to Link Description. On this tab leave all the other options the same.  Under Rules again check off Required.
LinkDescriptionMainLastly we want to edit the Post Custom Field within the form. For the Field Label we want to enter in Link URL. For the Field Type we want to choose the Website type.  Then for the Custom Field Name we want to choose New and enter in the Field Name of link_url for the Custom Field we created in Advanced Custom Fields for the Link Library Group. Again under Rules check off Required.  I have also checked off No Duplicates under rules for this field so that the form will check to see if the link has already been submitted.
LinkURLMainUnder the Advanced tab for this field we can also customize the error message that gets displayed by adding “This website has already been submitted to the Link Library.” to the Validation Message section.  This would then display the customized message instead of “This field requires a unique entry and ‘' has already been used”.

Next I usually change the theme associated with the Captcha.

Now you can click the Update Form button.  Next we should customize the Confirmations under the Form Settings section.  Editing the Default Customization should suffice for this.  By entering “Thank you for submitting {Link Title:1} for consideration to the Links Library.  If accepted you should see the link on the Links Library page.” allows for you to display the Link Title into the thank notification getting displayed upon form submission.  Then click the Save Configuration button to save this.


Leaving the Notification configuration the same will email all information to the admin email so if you want to customize this then you can do so if you want.  

Now we want to test this by going to the Preview section for this form, a new tab/window will open up with the form being displayed.  Enter in some dummy data and submit the form.  You should see the customized confirmation that we just set.  After seeing this confirmation message the next step is to go into the Link Library and confirm your new link is Pending Review within the system.  Go ahead and Publish this link so we have one in the system.

Next step is to create the shortcode that will display all of the links in the link library. Copy the following code into your themes functions.php or download the zip file plugin I created by downloading the Links Library Gravity Forms Plugin.

Feel free to customize the HTML of this code to display the information how you see fit.  After this we need to create the page to display the Links Library.  So create a new page and add the [linkslibrary] shortcode along with the Gravity Form we created to allow visitors to add their own links.  You can do this easily by selecting the Add Form button and choosing the form you created.  I like to leave the name in but not the description but that is up to you.
LinksLibraryPageCongratulations!  You have created a Links Library with the ability for your visitors to add their own links.  To see my sample page you can go to my Links Library with Gravity Forms front End Example page.


Share This

We are using cookies on our website

Please confirm, if you accept our tracking cookies. You can also decline the tracking, so you can continue to visit our website without any data sent to third party services.