Archive for the 'WordPress' Category

Get rid of comments on WordPress “pages”

I have a “Contact Us” page on AggieCampusology.com and a “Share a Story” page, and in the default WordPress setups, Pages include the ability to post comments, just like a regular Post does. But that doesn’t make any sense on a “Contact Us” or “Share a Story” page, where users are already being presented forms to be filled out, and I was worried about users getting confused, so, I wanted to remove the comments section from those pages completely, if I could.

The solution is:

1. Create a custom page template.
2. Remove the “comments” code from that template.
3. Use the new Custom template for the pages you don’t want comments on.

Hopefully the following is a decent enough explanation, if you want to do the same yourself:

  1. Copy the “page.php” file in your theme directory.
  2. Call the new copy of “page.php” “custompage.php” or something similar.
  3. Open “custompage.php” in your text editor, and replace it’s contents with this:

    <?php
    /**
    Template Name: CustomPage

    Page template, without comments at the bottom.
    */

    get_header(); ?>

    <div id="container">
    <div id="content" role="main">

    <?php if ( have_posts() ) while ( have_posts() ) : the_post(); ?>

    <div id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
    <?php if ( is_front_page() ) { ?>
    <h2 class="entry-title"><?php the_title(); ?></h2>
    <?php } else { ?>
    <h1 class="entry-title"><?php the_title(); ?></h1>
    <?php } ?>

    <div class="entry-content">
    <?php the_content(); ?>
    <?php wp_link_pages( array( 'before' => '<div class="page-link">' . __( 'Pages:', 'twentyten' ), 'after' => '</div>' ) ); ?>
    <?php edit_post_link( __( 'Edit', 'twentyten' ), '<span class="edit-link">', '</span>' ); ?>
    </div><!-- .entry-content -->
    </div><!-- #post-## -->

    <?php endwhile; // end of the loop. ?>

    </div><!-- #content -->
    </div><!-- #container -->

    <?php get_sidebar(); ?>
    <?php get_footer(); ?>

    *Note: all the above really does is duplicate the template called “loop-page.php” removing this code:
    <?php comments_template( '', true ); ?>
    **Note: you can also just download the above code from here, if you’d like to see it a little more cleanly.

  4. Save the “custompage.php” file.
  5. Open the page you want the comments removed from in the WordPress Admin UI.
  6. On the right under “Page Attributes” change the template from “Default Template” to “CustomPage”:
    Wordpress Page Attributes Admin UI - Select CustomPage
  7. Click “Update” to save the new settings.
  8. Check your new pages in a browser, to make sure everything works the way you want it (specifically that there are no longer “comments” at the bottom of your commentless pages!

If you want to read up more on creating your own page templates for WordPress, check the codex.

Oh, and sidebar here: I’m using TDO Mini Forms to power the “Share a Story” page on AggieCampusology.com, because I wanted a quick and easy way for users to submit entries, that will work with the publishing workflow that’s naturally included with WordPress, without making a user “register” or anything… seems to be working so far…

New WordPress Site – but I’m out of practice

I’ve been blogging since February 2002. At the time, I used PHPNuke to power my first blog: englers.org.

In 2002, I found WordPress, and launched inluminent.com, as a blog that was seperate and distinct from my family blog.

Over the next few years, I had a decent amount of free time, and didn’t have kids, so I could spend a lot of time learning more about WordPress, themes and plugins, keep my PHP skillz honed, etc…

Then I “grew up” and started running departments, divisions, or companies for other people, and got paid really well, but I never got to spend time with WordPress anymore.

Thus, inluminent is still using the “K2″ theme, englers.org is using one of the original themes that shipped with WordPress back in 2002, and StuffGeeksWant is running a theme that’s not very customized… AParatroopersFaith.com at least has ads on it, but the design leaves little to inspire people, because I’ve been so busy with “other stuff”.

So, I’m launching a new site today: AggieCampusology.com for Aggies everywhere to find and hopefully enjoy reading stories from other Aggies about their memories from their student years, or jog their memory about an old Campo they can’t quite remember…

But, I’m stuck on the “themes and plugins” that I should use, and how to customize them.

I’ll have to research those two things pretty well over the next couple of weeks, and maybe even take what I learn and upgrade all of my WordPress sites, to bring them into 2011…

Where should I start?

PR Spammers

I don’t know about the rest of you, but if you’re a blogger, you’re likely getting spammed by PR agencies. I know I am…

And so, in celebration of that fact, and hopefully, so I can make some money off the spam I receive, while also letting everyone know what the latest stupid Press Release I got was, I’m unveiling:

Unsolicited PR

Yep. It’s stupid, but simple…

And hopefully I’ll continue to get PR spam from stupid PR companies that aren’t paying attention to how they got my damned email address…

Ugh…

wp_post2cat test

I have a problem on another blog I just upgraded… wondering if this one has the same problem.

Looks like I have an old plugin that I need to upgrade, just don’t have enough to upgrade it. If anyone has upgraded WordPress to 2.3.1 lately, and knows which plugin is looking for the old “wp_post2cat” table, post a comment please.

8 Invaluable WordPress Plugins!

8 Invaluable WordPress Plugins! – Awesome list. Found a few I didn’t know about.

(0)

FAlbum

FAlbum: a WordPress plugin that allows you to display your Flickr photos and photosets on your site.

(0)

WordPress Theme Park

WordPress Theme Park

(0)

Building 9rules.com

Building 9rules.com with WordPress… extending WP to be a full-blown CMS.

(0)

WP-Cache 2.0

I just turned on WP-Cache 2.0, because I’m getting nasty notes from my hosting company (Dreamhost) that I’m using too many resources on my shared server. I totally understand their wanting me to use less resources, so, I’m hoping this cache plugin will help… Though, I’m not 100% sure WordPress is the thing that’s using all of the resources…

I hope this fixes the problem and I don’t have to go debugging all of my sites to find the problems.

If you see any problems with the site, or the RSS feeds, or anything, let me know.

Customizing WordPress

If you use WordPress, go read parts one and two of Claire Campbell’s Customizing WordPress series on Performancing.com.

(0)

The Five WordPress Plugins You Want

The Five WordPress Plugins You Want

(0)

Dreamhost Rocks! New Sale

I can’t say this enough. Dreamhost Rocks!

If you’re looking for a new shared hosting plan, you really ought to check out Dreamhost.

They just started a new sale this month:

From: [email protected]
Subject: [Announcement] New! All Shared Hosting Disk Space Doubled!
Date: September 1, 2005 4:26:34 AM CDT
To: John Engler

Hey Happy DreamHost Disk Hogs!

Starting Monday we began a new sale.. double (the starting) disk space on
all shared hosting accounts. As we’ve been known to do, we’ve also
applied this to all existing shared hosting customers as well!

Keep in mind your overall disk quota total may not quite double, because
of any additional weekly growth your plan may have undergone since you’ve
signed on. BUT, we’ve also doubled the weekly growth rate on all active
shared hosting plans to the following:

Level 1: 40MB/week
Level 2: 80MB/week
Level 3: 120MB/week
Level 4: 160MB/week

There is no action for you to take to get this increase… everything’s
already happened.

I’m not going to detail all of the stuff they offer with each plan, but I’d highly encourage you to check their sale our. Their “one-click installs” of some super useful software alone make it a really great hosting package. I mean where else can you buy a hosting plan for $8 a month, and get up and running within about 15 minutes of starting your hosting plan?

Their super easy to understand and use account control panel is also pretty damned spiffy.

They also pay referral fees for anyone that says you referred them when they sign up (yes, if you follow these links you’ll credit me with the referral). But that’s not the only reason I’m singing their praises… my diskspace with them is going up by 200MBs/week (I have two plans with them). That’s reason enough to sing their praises. Thank you Dreamhost.

Check ‘em out and tell them I sent you ;).

WordPress as a Tag Based App

I’ve so got to do what is described in this article: Turning WordPress Into A Tag-Based Blogging Application to OnAustin.com. That’s how I originally envisioned doing OnAustin, just didn’t have the time to think it all up.

WordPress Rocks!

WordPress, or “How I finally built the website I needed”

(0)

Slowly Getting There

In the past 24 hours, I’ve done quite a bit with the server move… I’ll try to document the actual steps I went through at some point, so that someone else moving from MT to WP can sort of follow my steps (hopefully they’ll plan it out a little better) if they want to.

Basically, this is what I did:

1. Set up a new site with DreamHost.
2. One-click installed WordPress from DreamHost’s nifty one-click application interface.
3. Exported my old MT data on the old server
4. Finished installing WordPress on the new server
5. Imported all old MT entries into WP.
6. Set up permalinks in WP with the cruft-free architecture I like.
7. Changed my MT archive templates, so they have redirect code in them for each archive type to point to the new WP url structure, as much as possible (MT dirify uses “_” instead of “-” to seperate words, so that sort of sucked).
8. Rebuilt all old MT archives and downloaded to my Powerbook
9. Used BBEdit’s powerful find and replace to batch find “_” and replace with “-”
10. Uploaded all old pages at /weblog/archives/ so that old files are in the right place to redirect people to new urls
11. Added a few lines to my .htaccess file, so that the old files work (I was using .htaccess to remove the .php from the end of those old urls).
12. Modified the WP templates a little to add the Google AdSense Code (will do more modifying later, to tweak the templates and styles exactly how I want them.
13. Installed WP Hashcash, a most excellennt plugin that Paul Beard recommended to kill comment spam in it’s tracks.

Overall, I’m more than pleased with WordPress, and am not looking back on Movable Type for a while… I just want to be an end-user folks… and with WP, I can be that end-user. It also helps that I know a little about PHP, and not a damned thing about PERL.