Why WORDPRESS is better?

How to create a custom PHP page that have access to all variables and functions within the environment of our WordPress blog? The answer is very simple.

wordpress-blue-xl

First create a page in your theme folder:

/wp-content/themes/your-theme-name/page.php

After that use this code in the top of your page

[sourcecode language=”php”] define(‘WP_USE_THEMES’, false);
require(‘../../../wp-blog-header.php’);
?>[/sourcecode]

Now you can easly  use all the functions specific to WordPress (primarily the loop) in your custom page.

You May Also Like

Use the RSS feed for a specific category

If you want to encourage your readers to subscribe to some of the updates of your site, it may be interesting to set up RSS feeds by category. The feed url to track updates on a category is obtained very simply by getting the URL of your category and add this /feed after the link they […]

Save more WordPress’ database disk space with a simple trick

If you use WordPress as blogging platform, and you have installed a recent version, you must have see that it has become more greedy in space. This is particularly due to the registration of “revisions”. What is “revisions”? These are versions of posts that are recorded as you write. This is a very useful feature […]

Hide a part from your content from non-registred visitors

Trying to get new “members” to his WordPress blog is not always easy. To try to push visitors to register and join your blog, you might resort to drastic measures as to conceal a portion of text. Or, another scenario, you might want to reserve a portion of text only to the most loyal visitors: […]

What’s New In WordPress 4.3

  WordPress is the most widely used content management system in the world. It is an excellent platform for beginners to launch their blog without needing expert knowledge on HTML. WordPress is also useful for sole proprietors who want their business to have an online presence but at the same time do not want to […]