Including Comments in Your Posts

September 18, 2007

I have had mixed messages about including comments with this theme. Some people want to use them since they have intentions on still using this as a blog theme, but others don’t want comments since they plan to use it as a newspaper site.

So I decided that the download wouldn’t include them, but I’m writing this tutorial to show you how to add them back into your theme files. All you need to do is open up your index.php file, and look for this line of code:

<p><?php _e('Sorry, no posts matched your criteria.'); ?></p><?php endif; ?>

Immediately after this line of code, add this:

<h4>Comments</h4>
<?php comments_template(); // Get wp-comments.php template ?>

Save the file, upload it back to your server and then your comments should appear under your posts!

How to Highlight the Current Page

September 18, 2007

I was asked if there was a way to highlight the current page of the theme – something that I overlooked when creating the theme, and also something very easy to include.

What you need to do is open up your style.css file, and add this code to the area that defines the #navbar:

.current_page_item a, .current_page_item a:hover {
background: #FFFFFF !important;
color: #2255AA !important;
}

One thing to keep in mind, is that this only works for pages that are shown in the navbar dynamically, so if you hardcode your navbar, this styling element will not work. The code above will display your active page the way you see it below:

How to Highlight the Current Page

Since the code for highlighting the current page is through css, you have the ability to change the text/background colors to suit your overall design needs.

Customizing the eNews & Updates Section

September 15, 2007

I am a really big fan of using Feedburner, which is the leading provider of media distribution and audience engagement services for blogs and RSS feeds. Our Web-based tools help bloggers, podcasters and commercial publishers promote, deliver and profit from their content on the Web.

The “Theme eNews & Updates Section” section in the left hand column of the homepage is coded to use the Feedburner Email Subscriptions feature – one that I use across all of my sites because I really like it. It seems that the majority of people redirecting their feeds use Feedburner, which is why I coded the newsletter signup section that way.

In order for that to work, all you need to do is go into the home.php file and look for this piece of code:

value="http://feeds.feedburner.com/~e?ffid=FEEDBURNERID"

Replace the FEEDBURNERID with your numerical ID, and then it will function properly.

How to Configure the Home Page

September 15, 2007

I thought it would be helpful to write up a tutorial on the basic structure/elements of any of our Gambling Theme homepage. Just about every aspect of the home page is dynamic, with a few small exceptions, so once you understand how things are pulled, it’s very easy to customize it to your needs.

Header
The blog title is dynamic, and does not use an image – as the original Revolution theme does. This means that upon download and activation of the theme, your title will automatically show in the upper left hand section of the site.

As for the main navigation, the blue navigation bar is coded to display a list of pages and the gray navigation bar is coded to display a list of categories. These can easily be changed, or with the help of the WordPress codex, can be re-configured to display differently.

Content Area
The left and middle columns of the homepage are configured to pull categories, which makes it very easy to change and customize. I figured that this was the best approach since most newspapers operate with the concept of “sections” like my demo site does.

There’s really only one piece of code that dictates what is shown on the homepage – what you will want to do is open the home.php file, and identify the various containers that are displayed on the home page. The piece of code that will become your best friend is this:

<?php $recent = new WP_Query("cat=10&showposts=10"); while($recent->have_posts()) : $recent->the_post();?>

The cat=10 piece of code is where you can select which category to show in each area – just replace 10 with the category ID that you want to display. This is how you can display the latest post of different categories down the middle column.

The showposts=10 piece of code is where you can select how many posts of that category you want to display. If you want to display 5 posts from category 3, then your code would look like (“cat=3&showposts=5”).

How to Use the Single Page 2 Layout

September 7, 2007

Inside any of our Gambling Themes download you will find an index.php file, and an index-2.php file. As of right now, the index.php file is the one that affects the way that your post pages look. These currently will have the same layout as the Gambling Theme demo Single Page, which have 2 columns.

However, there was a request for me to supply a 3-column version of a post page, which has the layout of the Single Page 2 on the demo site. If you are looking to have 3 columns on your post pages, you will want to use the Single Page 2 layout, which is controlled by the index-2.php file.

Basically what you will want to do is take the index.php and rename it to something else, so that you can take the index-2.php file and rename it index.php. (The main reason you want to rename the original index.php file is to avoid saving over it when you rename the index-2.php file to index.php.)

Once you have renamed the index-2.php file to index.php, upload it over the existing one on your server. Now, when you view your post pages, they will have the 3-column layout, as opposed to the 2-page layout.

How to Create an Archives Page

September 5, 2007

The Gambling Themes download is supplied with an “Archive” page template which will create a page that looks like this. This is an easy thing to create, and only requires a few simple steps.

The only thing you need to do while creating a page, is to enable the Archive Page template. You can name your archive page anything you want – for instance Archives, Sitemap, Library, etc. See the screenshot below for where the Archive Page template can be selected:

How to Create an Archives Page

You do not need to type anything in the text area while creating your page – simple fill in the page title box and select the Archive Page template. Publish the page and you should have your Archive page ready to go!