Separating Trackbacks and Comments in WordPress 2.7+

August 30th, 2009

How-To, Tutorials, WordPress Tutorials

Interested in separating your trackbacks and comments on your WordPress blog?   This blog tutorial should have you covered, whether you use a modern WordPress installation, or an older (pre 2.7) version of WordPress.   Below you’ll find we’ve put together a tutorial for both types of comment loops.

For WordPress 2.7+ Installations

Locate the following code in your index.php or single.php file (whichever file your theme uses to show single post pages):

<?php comments_template(); ?>

Replace that code with the following:

<?php comments_template('', true); ?>

That is it for that file.   Now go to your comments.php file and locate the following code:

<?php if ( have_comments() ) : ?>

Immediately below that code, insert the following code:

<?php if ( ! empty($comments_by_type['comment']) ) : ?>

Okay, once that is done, you’ll next need to scroll down a little further (still in the comments.php file) and locate the following code:

<?php wp_list_comments(); ?>

You’ll want to replace that code with the below code:

<?php wp_list_comments('type=comment'); ?>

Immediately below this function you should see the following code:

</ol>

Directly below that code, place the following code:

<?php endif; ?>

That should take care of the comment loop.  The last step is to insert the code which will display the trackbacks/pingbacks.  This can be placed anywhere below the code we just hacked above:

<?php if ( ! empty($comments_by_type['pings']) ) : ?>
<h3 id="pings">Trackbacks/Pingbacks</h3>
<ol>
<?php wp_list_comments('type=pings'); ?>
</ol>
<?php endif; ?>

Some people prefer to display their trackbacks and pingbacks below the comment form or somewhere else out of the way, so this is really up to you!  Just place the above code where you want to show them.   If you don’t like them showing at all on your blog, just don’t place the above code at all.

Once that is done, it is time to give it a try.  Check it out on your blog and let us know how everything turns out!

For Pre-WordPress 2.7 Installations:

Prior to WordPress 2.7, the comment form wasn’t nearly as functional as it is with the newer versions and also included a lot more code, but it is still possible to separate the trackbacks and comments using the old comment loop.     If you’d like to separate your trackbacks from your comments on a WordPress 2.6 or earlier installation, here is the steps you’ll need to take.

First, access your comments.php file and grab the following code:

<?php foreach ($comments as $comment) : ?>

Immediately after the above code, you’ll want to place the following code:

<?php $comment_type = get_comment_type(); ?>
<?php if($comment_type == 'comment') { ?>

Next, scroll down a little bit and locate the following code:

<?php endforeach; /* end for each comment */ ?>

Immediately before the above code, you’ll want to place this code:

<?php } /* End of is_comment statement */ ?>

This will filter out all of the trackbacks and pingbacks from your main comments loop. Now we need to create a second comments loop to display the trackbacks and pingbacks.  Almost immediately below the code from step 2 you should find this code:

<?php else : // this is displayed if there are no comments so far ?>

Immediately before the above code, you’ll want to place this code:

<h3>Trackbacks</h3>
<ol>
<?php foreach ($comments as $comment) : ?>
<?php $comment_type = get_comment_type(); ?>
<?php if($comment_type != 'comment') { ?>
<li><?php comment_author_link() ?></li>
<?php } ?>
<?php endforeach; ?>
</ol>

You can adjust this code to display how you want to, including using a different header if you have a specific look for your header 3.

If you’ve tried this tutorial, let us know how it worked for you in the comments!

Professional Real Estate WordPress Themes

August 28th, 2009

WordPress Themes

The internet has caused a lot of changes in how homes are bought and sold.  These days people go online to shop for new homes, so it is important for Realtors to have all of their properties listed online.   A popular trend seems to be listing properties using the WordPress blogging software, and their are a ton of great real estate themes available for Realtors to use!

Below we’ve gone out and collected our favorite real estate themes and provided you with screen shots and information on where you can go to get a hold of one of these designs.   Each design should include a control panel to easily setup your design and will also include a variety of features built in specifically for Realtors to use.  Examples include the ability to upload maps to the property, videos tours can be added, etc.

Agent WordPress Theme

agent-wordpress-theme

Multiple-Use ($59.95), All StudioPress Themes ($199.95)

Source/Demo | Purchase Read the rest of this entry »

Impressive Church WordPress Themes

August 27th, 2009

WordPress Themes

For religious websites or blogs, it has never been easier to create a holy feel to your websites that use WordPress!   WordPress theme designers have been hard at work building church templates which could be used for a variety of purposes, ranging from building a personal website to getting a ready-to-use church template for a church that wants to provide information about their organization (examples include hours, sermon times, maps and contact information, events, blog posts, etc).

Below you’ll find we’ve gathered a variety of church templates which are already available for anyone to use.   Once purchased, these themes should all include control panels which allow the user to help avoid having to deal with code, and many include other advanced features.

Grace Church WordPress Theme

grace-church-theme

Single-Use ($59.00), Developer’s Pack ($159.00)

Source/Demo | Purchase Read the rest of this entry »

Blog Tuts Gets New Design Courtesy of CustomTheme.com

August 12th, 2009

Blog News

Though Blog Tutorials is fairly new, I have big plans for the future of this website and decided that I wanted a solid design that would show that commitment to our readers.  As a result, I decided to work with the team at Custom Theme to get a custom design in place.

After about a week of development between design and coding, the new theme is ready and loaded!  Here is a screen shot of the new homepage:

blog-tuts

What do you think?   Let me know in the comments!

Blogger Themes, Widgets, Tutorials & Other Resources

August 9th, 2009

Blogger Themes, Blogger Tutorials

Although Blogger isn’t as popular as it used to be, it is still a great alternative for people who want to have their own blog without any cost or technical knowledge needed.  Once you have a blog together, you may want to spend a few moments customizing it by improving the design, adding custom widgets, or hacking the code to make things function the way you want it to.

While scouring the internet, we came up with a number of great resources for Bloggers users, which we’ve collected below.

How to Build a Better Blogger Template Series: