In this post I will show you how you can turn your sidebar into a dynamic part of your site by adding a Community News section. This is not something very complicated and it doesn’t require advanced web development skills.
I want to make it clear from the beginning that a Community News section is a part of your site, where users submit links and you will approve or not the link. In our case, a user will submit a news through a contact form and then you will add the info from the mail into your site. This can be made automatically but this tutorial will not cover that.
Here are the steps needed to create a Community News section for your site.
Step 1 – Create the Category for Links
In order to create this section, we will use the Links module inside WordPress. And the first step is to create a category dedicated to these types of links.
Step 2 – Add the Code Snippet
Now, edit your theme and place the following code where you want the Community News section to be displayed. When you add the snippet bellow make sure to delete the white space generated around “?”.
1 2 3
<ul> < ? php wp_list_bookmarks('title_li=&limit=10&categorize=0&orderby=id&order=DESC&show_description=1&between=<br />'); ?> </ul>
title_li – represents the title given to this section (in this case is left empty)
limit – represents the number of news
categorize – display the news’ category
orderby – sort your news by various options
order=DESC – shows the latest news in the top side of the news section
show_description – show the description or not
between – displays a string between the link and the description
* for additional info please check the WordPress.org documentation for wp_list_bookmarks()
Step 3 – Add a Submit Button
In this step all you have to do is add a button that will link to your Submit News page. In that page you will have a contact form that I will not cover in this tutorial.
Step 4 – Add Submitted News to your Community News Section
Now, assuming that you have some submitted news in your email account, you will sort them and add them to your section. In order to enter them, you will log into your WordPress backend and hit the Links button. After that go to Add link, enter the details from a submitted news, select the category you created at the beginning of this tutorial and press Add link. This is all you have to do.
The Plugin Solution
There are several plugins that can add this Community News section for you. The best plugin for that is the one made by Frank Verhoeven – FV Community News. This is a perfect solution for those of you that don’t want to deal to much with the PHP code.
I hope you will benefit from this tutorial. Cheers!