Integrating WordPress With Your Website | A Tutorial

WordPress! It’s the name of the web software that joins over 60 million people on the web into a family. With more plugins and themes available to WordPress users than you can possibly know what to do with, WordPress is a tool in your hands that is both free and priceless at the same time. With WordPress, you can transform your website into almost anything you can imagine and power the place on the web you call “home”.


So say hello to creating beautiful websites and blogs with WordPress and forget about everything else.

About WordPress

WordPress, as we established, is one powerful web software. It is usually used to create beautiful websites and blogs but if you already have a website, you can also integrate WordPress with your current website. Maybe you only want a couple of features that WordPress provides, or maybe you want to power your entire site using WordPress. So how do you give your WordPress blog a similar look to your site? How do you make an entire site run on WordPress? These are some of the things we’ll discuss in this short tutorial so buckle up because things are about to get technical.

First Things First

So you have a website already at and you want to add a WordPress blog to it. To start with, create a sub-directory at your site and name it ‘blog’ or anything else you want. The important thing here is that you have to create this folder. With that done, you will now have an empty sub-directory at

The next step is to download the latest version of WordPress at, upload the extracted files to the sub-directory you just created, and install WordPress.You can read more on how to install WordPress here.

Tweaking Regular PHP Pages

The next step is to add a small modification to regular PHP pages so that they can run on WordPress. To that end, add the following code at the begining of every page. Note that information shared here will not work on a MultiSite Network.


/* Turn me to WP! */

define(‘WP_USE_THEMES’, false);



About The Loop

In WordPress, The Loop is PHP code used to display posts. Using The Loop, WordPress processes each post to be displayed on a page and formats it according to specified criteria within The Loop tags.

To effectively use all the Template Tags and plugins available to WordPress users, it is important for website owners to get a hang of The Loop. When WordPress documentation says “This tag must be within The Loop”, the tag will be repeated for each post. For example, The Loop may, by default, display the following information for each post

  • Title (the_title())
  • Time (the_time())
  • Categories (the_category()).

Displaying posts on your webpage (2 examples)

1. To display 7 posts on your webpage, sorted alphabetically and also in ascending order, use the code:





$posts = get_posts(‘numberposts=7&order=ASC&orderby=post_title’);

foreach ($posts as $post) : setup_postdata( $post ); ?>

<?phpthe_date(); echo “<br />”; ?>

<?phpthe_title(); ?>

<?phpthe_excerpt(); ?>




2. To display the 5 most recent posts, use the code:

// Pull up the last 5 posts.


global $post;

$args = array( ‘posts_per_page’ => 5 );

$myposts = get_posts( $args );

foreach( $myposts as $post ) :    setup_postdata($post); ?>

<ahref=”<?phpthe_permalink() ?>” rel=”bookmark” title=”Permanent Link to <?phpthe_title(); ?>”><?phpthe_title(); ?></a><br />

<?phpendforeach; ?>

How to Create a WordPress Theme

So far in this tutorial, we’ve seen how to integrate components of WP into an existing site. Now if you want to have a theme to replace webpages on your website, you will have to create a custom WP theme.

In WordPress, WordPress Themes are files that work together to create the design and functionality of a WordPress site. Each theme may be different, offering many choices for site owners to instantly change their website look.

You may wish to develop a WordPress Theme to:

  1. Create a unique look for your site.
  2. Take advantage of templates, template tags and the WordPress Loop to generate different website looks.
  3. Provide alternative templates for specific site features such as category pages and search result pages.
  4. Quickly switch between two site layouts.

Theme development is beyond the scope of this article, but if you want to learn more about it, you can read this guide from the guys at

If you enjoyed this post, please consider leaving a comment or subscribing to the RSS feed to have future articles delivered to your feed reader.


Leave a Reply