Monday, October 22, 2018

Building a Non-blog Site with WordPress

This post digs into how you can use WordPress to run a regular, non-blog website.

WordPress began as a blogging platform and has a long-established dominance in the world of blogging. No matter what kind of blog you’re intending to run, WordPress can help you get it done with ease.

Be it a photo blog, a video blog or even a simple journal for your thoughts, WordPress comes loaded with all the bells, whistles and features that a blogger might ask for!

With that said, we can also use WordPress for creating a non-blog site — one that doesn’t really need a blog at all, but instead, is just a simple and straightforward website. Despite being primarily a blogging tool, WordPress can very well be made to run a non-blog website.

WordPress: Blogging Features

WordPress comes with a large array of blogging-specific features out of the box. These include, but are not limited to, things such as comments, blog posts, categories and tags, etc.

Now, it’s obvious that most of these features are vital for running and managing a blog site. However, when building a non-blog site, a good number of such features may not prove useful. We can, obviously, choose to leave them as they are.

But what about things on the front end? If we’re totally doing away with the blog posts, won’t blog archives give a “no posts found” message to users? What about the “Uncategorized” category? Such taxonomies too tend to have archives of their own.

The easiest way to fix this is to disable the archives altogether. Beyond that, we can also choose to disable many other blog-focused features.

Putting Together a Non-blog WordPress Website

Before going any further, let’s just face the truth: WordPress, in its current shape and form, expects its users to write and publish posts. If all you’re hoping to do is build a static site with a given number of pages, and have no requirement of publishing or regularly updating posts and other forms of content, the blogging sections are redundant.

Thus, it’s essential for us to tell WordPress that we don’t need the default post archives, taxonomy or author archives, and so on. The following code, for example, helps you remove all default blog pages and archives from your site:

/* Registering redirect action callback */
add_action('template_redirect', 'sp_remove_blog');
/* Removing blog from our site */
function sp_remove_blog(){
  //Works on archive template, single post template or index
  if( is_archive() || is_single() || is_home() ) {
    global $wp_query;
    $wp_query->set_404(); //404 not found
  }
}

The code above disables all blog archives, single post templates as well as blog index templates. Now, WordPress will redirect users from single post templates or blog archives to a 404 page. You can further set custom redirects in your .htaccess file, via a WordPress plugin, or in the code itself to redirect users to a specific page in lieu of 404 page, even the home page!

The above code should ideally be placed in the functions.php file of your theme or child theme. This step is necessary to prevent the creation of empty archive pages that may otherwise hurt your search rank. With that said, you can also, to some extent, disable several archives by means of a good SEO plugin, such as Yoast SEO (refer to plugin-specific documentation for detailed guidelines related to the same).

Finding a Non-blog WordPress Theme

There’s no shortage of WordPress themes to choose from. Even for non-blog websites, there are plenty of amazing WordPress themes out there both in free and premium variants.

Now, it goes without saying that you should pick your WordPress theme only from reliable sources. It’s very easy to fall prey to a bad WordPress theme and get your website compromised or hacked with minutes.

As far as free WordPress themes are concerned, the only place that you should look is the official theme repository. WordPress themes in the repo are quality-tested and generally come with better-quality code. Above everything else, free WordPress themes in the official repository are devoid of malicious code or malware.

For non-blog websites, the official repository has several tags that you can use to shortlist the perfect theme. For example, the “Education” feature filter generally provides themes meant for education-specific sites, but you can use these on virtually any non-blog site. The same applies to the “Holiday” filter as well.

Non blog site WordPress theme

When selecting a premium WordPress theme, make sure you opt for a reputed theme seller. Furthermore, the tags or genres of themes that you should focus on are commonly termed as “Business” or “Corporate” WordPress themes. Most such themes tend to come with a custom blog page template or layout, which should not be much of a worry as you would have disabled the archive page display using the above code anyway.

However, there is one particular step of caution that you should take when picking a WordPress theme for your non-blog website. By all means, avoid WordPress themes that come loaded with a heavy range of “custom” features, especially ones with custom shortcodes, custom buttons, custom page templates, and so on. Such WordPress themes tend to work out of the box only when you’re using WordPress the way it’s supposed to be. When you’re attempting to build a truly non-blog website in WordPress, the custom page templates and shortcodes can only get in the way. What will you do with a grid archive blog page template when you do not have blog posts to display in the first place?

Certain premium WordPress themes, such as Divi by Elegant Themes, are an exception to the above rule, as these themes tend to have an ecosystem and pre-made templates of their own. You can, in fact, select a Business template in Divi and have a non-blog site imported to your WordPress installation in no time! But for the most part, it’s preferable to use a series of WordPress plugins to achieve such customized functionality.
Speaking of WordPress plugins …

The post Building a Non-blog Site with WordPress appeared first on SitePoint.


by Sufyan bin Uzayr via SitePoint

No comments:

Post a Comment