16 May 2019

15 Places to Learn to Code for Free in 2019

There are lots of places where you can learn to code for free. With the boom in using website builders, people are turning to learning code to build and enhance their websites even more. People who know code already, are in a similar profession or are professionals, have been creating resources for many years in order to help others.

If you’ve never looked at web design or web development before, free coding resources can be a great go to, or at least a starting point. Once you’ve got to grips with the basics, you can find more in-depth courses to further your journey. Learning code does take a reasonable amount of time and effort, and you’ve got to want to learn it. Like most things, if you’re not interested, you’re probably going to struggle at the first step.

Who can learn to code?

Anyone can learn to code if they want to. Sometimes it’s worth considering what types of people might benefit more from coding in the long run. Let’s start with a few simple questions to establish if you’re the right person to learn code and make use of our free coding resources.

  • Do you enjoy web development, or the technical theory behind web development?
  • Would you like to be able to turn an application or website idea into something real?
  • Do you write content for a blog and therefore care about the quality and user friendliness of your site?

If you’ve answered yes to any of the above then it’s probably worth you learning code. Although it might seem daunting at first, it can actually be really fun and very rewarding.

You don’t need to be a computer geek to learn how to code. Coding can be done by anyone who has the thirst and desire to learn it. You can make mobile apps, websites and software, no matter who you are! And who knows, you may even turn it into a career or start your very own business.

Why should I learn how to code?

Learning how to code can reduce your overall costs if you are thinking about or currently hire a programmer or developer. In fact, if you become an expert in the field, not only could you save money, you could make money too!

Even if you just learn the basics of coding you could make a big difference to your site or business. Having the bare bone knowledge can often lead to more without even realising it.

Because coding is so popular, the amount of resources available can be overwhelming. That’s why I’ve put together some credible free coding resources for you. I’ll show you where to go (and what for), allowing you to decide the best route for your coding adventure.

Online Courses

1. Codecademy

Codecadmey is like a giant online free coding boot camp. The community at Codecadmey is absolutely massive and is an ideal spot for beginners to jump right in. When you’re learning a new skill, it can often be very useful to have access to a community whereby you can ask questions and discuss ideas. Codecadmey provides this on an extremely large scale with literally millions of users worldwide.

Codecademy is free which is why it’s listed here. Unlike many other companies, you don’t need to have a subscription to learn from Codecademy. One of my favourite features of Codecademy is that you don’t need any kind of software to begin coding. Their easy to use interface is built into their website so everything can be done in your browser.

Codecademy covers the following coding languages:

  • HTML
  • CSS
  • Sass
  • JavaScript
  • Rails
  • Ruby
  • SQL

(And much, much more).

2. Coursera

Coursera offers a large online library of free coding courses. All of the courses available are 100% free which is a great opportunity for anyone wanting to learn coding.

Coursera’s courses aren’t just run by anyone, they’re put together by leading universities and companies in the industry. Although it’s just as valuable to learn new skills from people who use them on a day to day basis, some people find it reassuring when there’s a big name behind the education.

If you want to obtain a Coursera verified certificate to ‘prove’ your coding skills, you’ll need to pay for it. The certificates range from $30+ and can go up to $100. Although this may seem a little steep, if you consider how much it would be to actually go to university of learn from leaders in the industry, it’s very reasonable.

Coursera doesn’t just offer your basic coding languages. They do cover HTML, CSS, JavaScript etc. but they also go far beyond this. There’s specific specialised courses available too (which you do need to pay for).

3. Udemy

Udemy isn’t solely focussed on coding languages but they do offer courses on these. You can access a wide range of in-depth courses through Udemy’s library. Whether you want to improve on existing coding knowledge or learn new skills, Udemy offers it all. From game development to software development, creating apps to testing them, there’s plenty to sink your teeth into.

Courses allow you to learn at your own pace, and will save your ‘history’ so you can come back to it at any point. There are both paid and free courses available, from web development to data science (and more).

Udemy courses can actually be created by anyone, so they don’t necessarily represent the ‘standard’ in any particular topic. Each course has a list of reviews from actual users, so you can judge whether the course is right for you or not. I’d recommend checking out the reviews before you start one!

4. Free Code Camp

Another free coding boot camp, Free Code Camp has a wide and established curriculum to teach from. All of the projects available allow users to work with hands on experience. What I love about this coding resource is the community behind it. There are millions of other users willing to support and help each other which is lovely to see in this day and age.

Free Code Camp doesn’t just teach you coding languages. It offers a lot more, such as being able to apply said coding to real world scenarios. You can build projects and take part in them with others as well as getting a certification at the end of it.

For example, they will actually prepare you for your developer job interview! How cool is that? Free Code Camp is a non profit organisation offering accessible coding to anyone.

YouTube Channels

5. DevTips

DevTips is one of Travis Neilson’s YouTube channels, who specialises in ‘making things for human people’. The YouTube channel focuses on web design and web development and sometimes offers live Q & As.

DevTips provides weekly shows for those that want to be inspired. The channel opens up opportunities for people to learn development and programming together. Watchers can get involved during the shows, creating a community aspect on a weekly basis. Shows start at 8:00 PM (GMT) every Friday.

6. Coder’s Guide

YouTube channel Coder’s Guide provides a video series on coding languages like JavaScript, HTML and CSS. You’ll find a range of videos from quick learning to in-depth courses, job interview preparation and more.

Neil Rowe offers up some easy to follow video tutorials for anyone wanting to learn coding and web development. He shows you step by step what to do and how to do it. What’s nice is that Neil himself will respond to comments on his videos, answer questions, and get involved in conversations.

7. LearnCode.academy

LearnCode.academy’s YouTube channel is regularly updated. As well as offering free coding videos to help you learn, they also provide tips and tricks to making the best website.

The YouTube channel covers web development tutorials, web design tutorials and more. Some of the languages that are covered are HTML, CSS, JavaScript, CSS Layouts, Responsive Design, and React.js.

HTML & CSS

8. Learn CSS Layout

Learn CSS Layout is ideal if you know the basics of HTML and CSS to begin with. If you don’t have the basic knowledge, you can use some of the other resources I’ve mentioned in this guide to get you started.

It will teach you the best ways and fundamentals of setting up a website in terms of layout. This is going to be valuable know-how when you start creating your own website, and useful for ensuring your site is mobile-friendly.

9. Mozilla Developer Network

The Mozilla Developer Network provides free HTML and CSS documentation to anyone and everyone. They provide tutorials for a selection of topics, from beginner to expert skill levels.

The idea behind the Mozilla Developer Network is to provide articles about Mozilla code. Whether you want to download it or build it, you’ll need to know how the code works. Topics also cover add-ons for Mozilla apps.

10. HTML Dog

HTML dog has some great beginner HTML tutorials (like this one). They also cover CSS tutorials and appeal to beginners and advanced users alike.

HTML dog is a useful resource for anything HTML, CSS, or JavaScript. These languages cover the basics of web development and web design and provide a useful stepping stone into the world of development and programming.

Git

11. Try Git

Created by Code School, Try Git pretty much does what it says on the tin. You can try out your Git knowledge (if you have prior experience) or simply experiment with Git.

12. Git Immersion

This is the place to go if you’ve never used Git before. Git Immersion offers its users a guided tour into the world of Git, setting you up with the basic knowledge.

Coding Blogs

13. Tuts+

Tuts+ offers loads of coding tutorials which can be pretty helpful if you’re looking for something specific. They do have courses too, but these are paid for.

Tuts+ has over 1200 video courses, 250 eBooks, and almost 30,000 tutorials. You can use your newly founded knowledge and skills and make use of Envato Elements. Here you’ll have access to thousands of website templates and themes, designs, and almost half a million photos.

14. David Walsh

David Walsh is a senior developer at Mozilla. His blog (with other contributors aside from himself) offers demos, tutorials, and how-to guides.

David’s blog covers popular topics including .htaccess, CSS, WordPress, SEO, JavaScript, HTML5, and lots more. His blog offers news related to the web development world, alongside incredible demos and feature discussions.

15. CSS Tricks

There’s a whole bunch of stuff on CSS on the CSS Tricks blog. They’ve got loads of resources as well as covering other subjects like JavaScript and PHP. When owner, Chris, started the blog in 2007, he was mostly writing about CSS. It occurred to him that HTML and JavaScript were being mentioned a lot as they both form the basis of creating websites.

Because the blog was made on WordPress, Chris found himself talking about WordPress too, so the name quickly became desolate as he now covers a large range of topics.

CSS-Tricks mainly focuses on building websites and everything else that goes with it. The blog have permanent staff writers as well as guest authors who all offer a different perspective within their content.

Share this
12 Nov 2018

21 Easy Ways to Speed Up WordPress

Why should you speed up WordPress?

WordPress is an extremely popular publishing platform which is used to power millions of blogs and websites around the world. It can be used to create blogs and websites that are rich in features and enables you to publish posts and pages, customise your site with various widgets, themes and bespoke menus and use plug-ins to make your site even more functional and impressive.

In Google’s Webmaster blog, we learn that users don’t want to wait for websites to load. If a site doesn’t load within 3 seconds, there is a very strong correlation showing site abandonment.

One of the main drawbacks of WordPress is that it can sometimes grind to a halt for various reasons. However, there are many steps you can take to speed up the performance of WordPress to save time and make using it more enjoyable.

At UK Web Host Review, we’ve taken the time to outline some of the most effective techniques for boosting the performance of your WordPress site (we currently use all of these techniques and they work VERY well!). 

 

1. Enable Browser Caching

Caching is a way of storing static files (ones that won’t change) like images, CSS, and JavaScript. By enabling browser caching, you can actually speed up your WordPress website. When you enable browser caching, your database doesn’t have to be communicated with every time someone visits your site.

By doing this, and minimising the retrieval of content from your database, your website’s speed will increase. This will enable a better user experience for your visitors, as well as increasing your page speed (which is a rating factor for SEO).

You can enable browser caching in a variety of ways through WordPress. However, my personal recommendation is to use W3 Total Cache plugin. Simply navigate to the plugins section on your WordPress dashboard.

 

2. Remove Unnecessary Plugins

It’s quite easy to get carried away when you first install your WordPress site. There are so many plugins to choose from, all boasting great features and tools to simplify managing your site. The problem is, plugins can cause issues, namely slowing down your site. Out of date plugins, conflicting plugins, and useless plugins can clog up your WordPress site.

It’s really important to manage your plugins effectively. This includes deleting plugins that you no longer use, or ones that aren’t actually necessary for your website. It’s going to take a bit of effort on your part here, researching the best plugins for their desired purpose, but I promise you it’s worth it!

When you’re ready, simply navigate to the Plugins section on your WordPress dashboard and locate the area called Installed Plugins. You can view your installed plugins and choose to delete those that you no longer need.

 

3. Choose the right WordPress host

Reputable shared web hosting providers such as SiteGround or Hostinger will spend sufficient time on optimising performance, though shared hosting does mean sharing resources with a large number of other people. Busy neighbouring sites can have a significant impact on the whole server and therefore your site. We also suggest that you stay away from any free web hosting services as these often have numerous downtime and site speed issues.

You may well wish to opt for a managed hosting service over a shared one. Opt for a managed service and you’ll be able to benefit from highly-optimised server configurations as well as automatic back-ups, updates and complex but valuable security configurations that will enhance the security of your site. This step is regarded as one of the most effective ways to speed up WordPress.

The hosting of your site is widely agreed to be amongst the most important factors when it comes to loading times. Many providers offering “unlimited” bandwidth are unable to provide impressive loading times, especially during peak hours. Furthermore, the vast majority of these providers can’t guarantee more than 99% uptime per month.

 

4. Compress your Images

Images are one of the most resource hungry aspects of a WordPress website. Because they can take up a large amount of space (if not compressed), they can slow your website down. For websites that focus on imagery, like photography or art portfolios, this is a must!

Image compression takes an existing image and compresses it’s size, whilst maintaining an acceptable level of quality. Unless someone is viewing your website on a 60 inch television, they’re probably not going to notice that your images have been compressed.

My favourite image compression plugin for WordPress is called Smush. It’s super easy to download this plugin from the WordPress plugins store and install it to your site. You can configure Smush to automatically compress images when you upload them so you barely have to put any effort in yourself!

 

5. Update your site regularly

Updating your site regularly is essential. Themes and plug-ins are refreshed regularly, and if you fail to take advantage of them, you could become vulnerable to bugs and security issues as well as slow loading times.

Keep on top of the latest updates to avoid performance being affected. Make sure your site, plugins and themes are all updated to the very latest versions.

What’s also good is to update your site with new content regularly. By doing so is looked on very favourably by the likes of Google, who also reward fast-loading sites that offer fast performance with better rankings.

 

6. Use free tools to optimise WordPress

Its really easy to get detailed performance statistics and data regarding your website. Making use of these tools (for free) can teach you all there is to know about your site, thus being able to optimise it.

If you have a well optimised website, your website will load faster and your SEO score will sky rocket. Here’s a list of a few free tools you could be making use of:

 

7. Take advantage of excerpts

WordPress will keep the entirety of each article on your homepage and your archives unless you instruct it not to. This leads to homepages, categories, archive pages and tags loading slower.

If full articles are shown, visitors may not decide to visit the page in question, which means pageview numbers can be negatively affected.

By using excerpts, you can convince users to click through to view full pages and spend more time on your site. The Settings menu enables you to show summaries to your visitors rather than the full text.

 

8. Break comments into pages

Although it’s always great to see vast numbers of visitors commenting on your articles and joining the discussion, loading comments can also take time.

The Discussion part of the Settings menu offers a Break Comments into Pages option that will help you avoid this problem and enable you to avoid slow loading times likely to send guests away.

 

9. Content Delivery Networks

A Content Delivery Network or CDN will help you speed up loading times for visitors no matter where they are. Without a CDN, users in the country where your server is based will experience faster loading times than visitors located elsewhere.

CDNs consist of servers from across the world, with all servers storing static files like images, JavaScript and CSS that make up your site. Using a CDN means users will be served files from the server nearest to them, whilst your own web hosting server will perform quicker because of the reduced pressure on it.

 

 

Most well-known and well-read WordPress blogs are now making use of CDNs in order to cater for visitors across the world effectively. The Max CDN Content Delivery Network has a great online reputation and has been complimented for its intuitive dashboard and generous pricing structure. Furthermore, it comes with video tutorials designed to make the setting-up process smoother and quicker.

 

10. Avoid uploading videos directly to WordPress

Uploading your videos directly to WordPress can also vastly reduce loading times. What’s also worrying about this is that hosting videos directly can be very expensive in terms on bandwidth, and you could be faced with a big bill from your hosting provider, who may even decide to close your site.

Even if you’re paying for so-called unlimited bandwidth, you may still be met with tough penalties. Hosting videos will also make backup sizes swell and make the restoration process much more difficult.

However, help is at hand. You can instead embed videos that you have uploaded to services like YouTube who do have the bandwidth. Just cut and paste the URL into the post and it will be embedded seamlessly, helping you avoid slow load times and penalisation.

 

11. Choose a speedy theme

Though scores of great WordPress themes are available, it’s important to consider speed when selecting one. Some of the most visually-impressive themes have bad coding and can have an adverse effect on load times.

Try to strike a happy balance between performance and visual quality when selecting a theme. You may need to experiment with a number of themes before you reach the best compromise.

Many WordPress site owners opt for simple theme and select a number of high-performance plugins to get the right visual feel and efficiency. Some of the most reputable theme shops include StudioPress and Array Themes and are great channels for obtaining impressive themes that won’t result in snail-like loading times.

 

12. Faster slider plugins

Sliders are particularly popular amongst WordPress users but do have a tendency to lengthen loading times. What’s more is that they can even undermine your attempts at speeding up your site, such as choosing optimised images.

It’s wise to spend time online researching the best slider plugins for your needs. Nivo Slider, Soliliquy and Meteor all have a great reputation amongst leading WordPress experts and veterans.

 

13. Faster gallery plugins

Do you need to display a large number of photographs? As we have already mentioned, photographs that haven’t been optimised can lead to poor loading times. Many professional photographers using WordPress opt for speedy gallery plugs ins that have been designed for speedy loads.

There are many reliable and fast gallery plugins on the market – some of the most reputable and acclaimed include Envira Gallery, NextGEN and Foo Gallery.

 

14. Splitting longer posts into pages

There are many great reasons for adding detailed, lengthy posts to your WordPress site. Long post can provide your readers with detailed analysis and facts about complex topics and really establish yourself as a leading player in your field.

They can also be fantastic for SEO. However, if you do post extensive information supported by a string of images, loading times can be impacted.

One way to get around this is to separate your longer posts into pages. Splitting posts into sections isn’t complex – you simply need to use the <!––nextpage––> tag when you wish to end one section and begin another. Long posts don’t need to have an unwanted effect on loading times.

 

15. Prevent pingbacks and trackbacks

Pingbacks and trackbacks tell you whenever your site receives a link, but they can put your server resources under pressure. What’s more there are other resources you can use to assess links of your site, such as Google Webmaster Tools. The pressure on your server comes from the way requests from WordPress are sent back and forth when link ups are made.

Additionally, hackers and other cybercriminals can exploit pingbacks and trackbacks in DDoS attacks. You can switch off this functionality in the Discussion area of Settings. Simply deselect “Allow link notifications from other blogs (pingbacks and trackbacks)” to disable pingbacks and trackbacks.

WordPress is designed to interact with other blogs equipped with trackbacks and pingbacks. When you are mentioned on another site or blog, data on your own post is updated. Don’t worry about backlinks being lost if you disable trackbacks and pingbacks – you’ll only be losing clutter on your site by taking this step.

 

16. Cut down external HTTP requests

Though it is helpful to use some files from other sites, overdoing things can also impact load times. A large number of plugins and themes load files from other sites, with many making use of scripts, images and more from the likes of Google and Facebook. However, if your plugins make a large number of requests, chances are that loading times will be effected. You can get around this by disabling some scripts and styles.

Alternatively, you may wish to merge them into a single file. This task may seem more complex than many of the other tips and tricks we’ve discussed in this article, but making these changes and gaining a rich understanding of what you need to do to reduce HTTP requests can be worth its weight in gold. There are many tutorials online that will show you how to cut down HTTP requests and disable JavaScript and CSS files from plugins to boost loading times and bring your visitors a smoother and faster site experience.

The process of minification won’t lead to unwanted results but will eliminate unnecessary characters from HTML, JavaScript and CSS files. Minification reduces load times and boosts performance by removing redundant code and unnecessary characters. Various studies have shown how minification makes a significant difference to the performance of WordPress sites. You can also speed up WordPress by minimising page size and reducing the number of calls to JavaScript and CSS.

17. Use GZIP compression

Many computers owners choose to compress files on their computers in order to save disc space after looking for ways to speed up WordPress. The equivalent of this for WordPress users is GZIP compression, which cuts down bandwidth usage and reduces the time it takes for users to access your site. It means the browser unzips your site before they enter it. There are many plugins available that will enable you to compress your files, though you can also add the code below to your .htaccess file.

AddOutputFilterByType DEFLATE text/plain
AddOutputFilterByType DEFLATE text/html
AddOutputFilterByType DEFLATE text/xml
AddOutputFilterByType DEFLATE text/css
AddOutputFilterByType DEFLATE application/xml
AddOutputFilterByType DEFLATE application/xhtml+xml
AddOutputFilterByType DEFLATE application/rss+xml
AddOutputFilterByType DEFLATE application/javascript
AddOutputFilterByType DEFLATE application/x-javascript

 

18. Reducing database calls

Again, this step may seem somewhat complex but you can expect your efforts to pay off if you invest time in understanding what you need to do to reduce database calls.

You will need to gain some understanding of PHP and the template files of WordPress to perform this step. Unnecessary direct database calls and requests can put too much pressure on your server and can result from badly-coded WordPress themes. Even themes that are otherwise coded impressively may make database calls just to get simple information.

The tag <?php marks the beginning of a new database call. If you’re using a child theme to customise your site, the calls can be deleted and replaced with specific information. You can also replace them with static information when using a parent theme.

 

19. Remove unnecessary information from your WordPress database

Once you have been using WordPress for some time, you will probably come across a significant amount of unnecessary information.

The WP-Sweep plugin can be used to eliminate much of this and will get rid of unused tags, trashed posts and much more, giving your database a much-needed and valuable spring clean. Furthermore, you can optimise the entire structure of your database with just one click.

 

20. Cut back post revisions

Post revisions can fill up a great deal of your database, and some experts suggest that they might have a negative impact on plugin database queries. Plugins that don’t exclude revisions could search through revisions when they don’t need to.

However, it’s relatively easy to limit the amount of revisions kept for every article. You can achieve this by adding the code define( ‘WP_POST_REVISIONS’, 4 ); to your wp-config.php file, which will result in only the last four revisions being kept and older revisions being discarded.

If you’d prefer to use a plugin for post revisions, options are available. A plugin called Revision Control enables you to revert to previous versions if mistakes are made and enables you to decide how many revisions you wish to save so your backend isn’t clogged up with scores of old drafts that you no longer require.

 

21. Stopping hotlinking and leaching of your content

The higher the quality of your content is, the bigger the chances of someone else using it without your permission become. When other site owners choose to serve your images from their URLs on your site rather than uploading them to your servers, they are using your bandwith, without you even being able to enjoy extra traffic as compensation. Add the code below to your .htaccess file to stop others hotlinking your images.

#disable hotlinking of images with forbidden or custom image option
RewriteEngine on
RewriteCond %{HTTP_REFERER} !^$
RewriteCond %{HTTP_REFERER} !^http(s)?://(www\.)?ukwebhostreview.com [NC]
RewriteCond %{HTTP_REFERER} !^http(s)?://(www\.)?google.com [NC]
RewriteRule \.(jpg|jpeg|png|gif)$ – [NC,F,L]

You may also be negatively impacted by content scraping websites, which take content from your RSS feed to create their own posts. Fortunately, there are many tutorials online which will help you prevent content scraping from your WordPress site.

Share this
01 Aug 2017

Show Category Descriptions in WordPress

If you wish to add category descriptions to your WordPress site, help is at hand. Before we look at ways to display category descriptions in WP, let’s have a quick look at some of the main reasons why WordPress has become such as popular content publishing profile over recent years.

One of the most celebrated things about WordPress is the fact that that you can change the design of your site extremely quickly without compromising the quality of its appearance. There are thousands of themes to choose from and an active global community of WP experts willing to help you out if you do ever find yourself stuck and require advice on making its many features work for you. Plugs in enable you to boost the functionality of your site massively, even if you only have the most basic knowledge of programming. More than 10,000 plugins are on offer, and new ones are being developed and launched all the time. Whether you need a plug in for social media integration, photos, SEO or many other purposes, help is available.

Updating a WP site is easy. Anyone who can create a Word document can publish an article on WP. What’s more is that the search engines treat WP sites extremely favourably, and Google has recommended WordPress for business sites.

If you do wish to display category descriptions on your site, read on. Categories are incredibly useful and can boost the WP experience not only for you but your visitors too. They enable you to organise content with ease and make it much easier for users to find it. Furthermore, they are great for SEO.

WordPress has two built-in taxonomies known as categories and tags. The taxonomies make it easy to sort content into topics. In WordPress, you can add descriptions to categories, which is something many WP users remain unaware of because they can create categories when writing posts which don’t let them add descriptions.

To get around this, go to the Posts » Categories page. If you are creating a new category, you can enter the name and description and click on the ‘Add new category’ button.

You can also add descriptions to categories that already exist by clicking on the ‘edit’ button beneath said category. Do this and you’ll be taken to the category edit screen which lets you add a description. Click the ‘update’ button so your changes are not lost.

You can go through this process again as many times as you need to until all your categories have descriptions. The same method enables you to add descriptions for your tags.

Do you need to show category descriptions on the Category Archive Page?

Whilst many WP themes automatically show the category description on the category archive pages, this is not always the case. If your theme is not showing category descriptions on archive pages, you can put things right by editing your theme files. Use an FTP client to connect to your WP site and go to /wp-content/themes/your-current-theme/ folder. Find and edit your category.php file. If your theme doesn’t have one, you can edit the archive.php file. Copy and paste the following code in the place you want your category description to be shown.

1

<?php

2

the_archive_description( ‘<div class=”taxonomy-description”>’, ‘</div>’ );

3

?>

Save the changes and upload the file to your website. Once you have done this, you can head to the category archive page on the site to view the description.

Show Category Description in WordPress Theme

You can use the category_description template tag below to show the category description in other areas of your website.

<?php echo category_description(3); ?>

Replace 3 with your own category ID.

Use the code below to display category descriptions inside a single post.

1

$catID = get_the_category();

2

echo category_description( $catID[0] );

This code will get all the categories for the current post and output the category description of the first category.

You can list each of your WordPress categories with a description in list format by adding the code below to your theme’s functions.php file:

01

function wpb_catlist_desc() {

02

$string = ‘<ul>’;

03

$catlist = get_terms( ‘category’ );

04

if ( ! empty( $catlist ) ) {

05

foreach ( $catlist as $key => $item ) {

06

$string .= ‘<li>’. $item->name . ‘<br />’;

07

$string .= ‘<em>’. $item->description . ‘</em> </li>’;

08

}

09

}

10

$string .= ‘</ul>’;

11

 

12

return $string;

13

}

14

add_shortcode(‘wpb_categories’, ‘wpb_catlist_desc’);

The above code will create a shortcode. This will display all categories and the descriptions that go with them in a plain list. You will then be able to use [wpb_categories] in your posts and pages. Enable shortcodes for widgets if you need to use the shortcode in a text widget.

More about Category Descriptions

The Category Description function is overlooked by many but can be incredibly useful. You may have seen the category description on many occasions without noticing it. Many people glance over this box when they are setting up and editing descriptions. Though not all WordPress site owners require or even want a category description, descriptions can provide your users with valuable information, make your site more exciting and efficient and boost the SEO of your site.

Do I need to use Category Descriptions?

Category Descriptions may prove invaluable if you regularly post about various topics and feel it would be beneficial to divide the content on your site into sections. If you don’t specify a category, your post will be filed in the default one, which is often ‘Uncategorized’. You can change your default category in the Settings » Writing screen. Posts don’t have to come under a single category – they can be filed under various different fields, which is very handy if you are posting content that suits a number of different fields. Your WP Posts can also have tags as well as categories. More and more WP users are experiencing the benefits of Category Descriptions.

Share this

UKWebHostReview.com - Best Web Hosting Comparison