WordPress Custom Post Type as Static Home Page

I’ve been searching the last couple of days for some sort of solution to this problem. I’m using custom post types in WordPress and I want to be able to specify my static home page to be one of my custom post types. In the WordPress Reading options it only lets you specify ‘Pages’, not any of your custom post types.

I came across this discussion here, but it didn’t lead to any kind of a solution.

Another possible is here, but it wasn’t a good solution because you had to create an actual page, and then use a custom template. A little too messy for my taste.

I also found this which was the closest one yet. I found out, that manipulating those options does work, but not as intended. The home page was auto-redirecting to the permalink of my custom post type. So, in principle, when I went to my home page I was seeing my custom post type, but when looking at the address bar, it actually just redirects to the permalink. This wasn’t the solution I was looking for.

Then I decided that if you could specify the post ID somewhere (in my theme settings) of the page I wanted to be the home page, it would be as simple as modify the query for my main loop. I came up with the following code placed in my main index.php file for my theme before the loop starts, and it seems to work perfectly.

$postId = 12345; // substitute with the ID of the post you want to show
if ( is_home() && '' != $postId ) :
$post = get_post( $postId );
query_posts( array( 'post_type'=>$post->post_type, 'p'=>$postId ) );
endif;

Smarty Plugin: Autolink URLs

This is a plugin for the PHP template engine Smarty. It’s a modifier plugin, so you can use it like this:

{$text|autolink}

The purpose of the plugin is to automatically detect URLs within a string and wrap them in HTML anchor (<a>) tags.

Features:

  1. will detect URLs with or without http://
  2. detects http or https
  3. adds a _blank target and a nofollow rel (you can edit the file to remove those if you wish)

Let me know if you find it useful.

Download it here

Just place it in your Smarty plugin folder

PHP ZIP Archiver

I recently had to create a piece of PHP code that will take an entire directory on my hard drive, and make a .zip file out of it. I needed it to be recursive and I needed it to be simple. My code stemmed off the code I originally found here, but the problem was that it referenced another piece of code that must be required to use, and that code was held behind a registration page. So, I went ahead and created my own code that is self-sustaining and open source. You can check it out over at Google Code. I hope you enjoy it and let me know if you need any help with it.

GMails New Priority Inbox (beta)

Google has released a new feature for GMail called Priority Inbox Beta. It works by analyzing your email and filtering it out what it thinks are the important messages and giving you easier and quicker access to those. It does this by seeing which emails you read, and which ones it applies to. So, it’s customized for each individual user. At first the filters won’t be very accurate, but by seeing your patterns over the course of time, it will become increasingly more accurate. You can even tell Google that a certain email is “less important” or “more important” to help out it’s learning curve.

Continue reading

Dust 514 – New Console FPS MMO by CCP

Seems like CCP has been busy… seems like they also have too much money on their hands. What happens when you have a company run, built, and dreamed of by gamers? Apparently you get CCP. Their persistent world MMO EVE Online has been a classic. Something all other MMOs should strive to be. Now they are branching out. They have been busy developing a first person shooter called Dust 514. Apparently they are wanting to release it on consoles. “Well, what’s so cool about that?” you ask. I’ll tell you. The two games (EVE and Dust 514) will exist in the same universe. Actions done in either game will effect the same universe. Dust 514 will be battles in the trenches on the planets in EVE.

Continue reading

New Free MMO – Allods Online

So, I came across this MMO yesterday called Allods Online. I was very very skeptical. I’ve been looking for a good MMO to get into lately and the barriers have either been high-barriers to entry (EVE Online), you have to pay for it (just about any MMO out there), or bad graphics and childish gameplay (WoW). I was first impressed by the graphics for Allods. I looked at a couple of their videos on their website, and it had me intrigued. Then I saw that it was free subscriptions. Double-take! My first thought was then “they must make you pay for in-game items”. Not the case (at least as far as I can tell).

Continue reading

WPTouch and Webcomic Working Together

I happen to be a user of both WPTouch (a plugin that makes my blog mobile friendly) and Webcomic (a plugin and theme that allows you to organize comic series). The problem lies in that webcomic uses a custom post type for displaying the images associated with each comic and WPTouch has no idea how to display a webcomic. Thus, when someone visits my site on a mobile device, they can see any text that I post for a webcomic, but they can’t see the image associated with my post. Today I resolved to fix that problem and I was successful. While it’s not the most elegant of solutions, it at least works for now and I hope it can help others.

Continue reading

Facebook Places – Notification Settings Falacy

I’m going to try and nip this one in the bud. For those of you who don’t know what Facebook Places is you can read about it here. It is a new service by Facebook that allows you to “check in” at a location to let other people know where you’re at and who you’re with. I saw someone with this status today:

Facebook launched Facebook Places yesterday.
Anyone can find out where you are when you are logged in. It gives the
actual address & map location of where you are as you use Facebook.
Make sure your kids know too. TO UNDO: Go to “Account”, “Account
Settings”, ………”Notifications”, then scroll down to “Places” and
UNCHECK the 2 boxes. Make sure to SAVE changes and re-post this message

Continue reading

Stay Safe On Facebook

I’ve been on Facebook for a long time. I have seen people do some pretty dumb things when it comes to protecting themselves, their identity, and the identities of their friends and loved ones. One of the biggest threats on Facebook is to give strangers access to your personal information. A lot of people I know play Facebook games which rely on you getting your friends to be neighbors. What typically happens though is that your personal friends don’t play those games, so you go out and find a bunch of random people to be friends with so that they can help you in the game.

Continue reading

The Future of Character Modeling in Video Games

One of the biggest disconnects in video games has been the inability for a 3D model to fully interact with it’s environment. Hair never seems to follow the laws of gravity, hands and arms seem to float right through clothing. I have often been disappointed that no one has stepped forward to solve some of these basic modelling problems. It seems now that my long wait could be over. In a video released by CCP (EVE Online) they showcase a technology that solves a lot of those interaction problems. It seems this will be the technology they are going to be using when they migrate to a fully 3D modeled character (as opposed to the static character portraits they’ve used for years).

Continue reading