Archive for the ‘wordpress tutorial’ Category

fun with custom post types!

i’ve added a new feature to my site: custom post types. you can see the page here — as you can see, it’s all of my sketches i’ve done since last august

code

functions.php
first add this to allow for featured images (if it’s not already in there):

add_theme_support( 'post-thumbnails' );

This part will register the custom post type to wordpress

add_action( 'init', 'create_sketch' );
function create_sketch() {
$labels = array(
'name' => _x('Sketches', 'post type general name'),
'singular_name' => _x('Sketch', 'post type singular name'),
'add_new' => _x('Add New Sketch', 'Sweet'),
'add_new_item' => __('Add New Sketch'),
'edit_item' => __('Edit Sketch'),
'new_item' => __('New Sketch'),
'view_item' => __('View Sketch'),
'search_items' => __('Search Sketches'),
'not_found' => __('No Sketches found'),
'not_found_in_trash' => __('No Sketches found in Trash'),
'parent_item_colon' => ''
);

$supports = array('title', 'editor', 'revisions', 'thumbnail', 'comments');

register_post_type( 'sketches',
array(
'labels' => $labels,
'public' => true,
'supports' => $supports
)
);
}

Read the rest of this entry »

wordpress: get post slug

originally found this on josh stauffer’s site. just wanna add to my site so i can pull it up easily

$slug = basename(get_permalink());

wordpress: installing wordpress locally on your pc

as i write the title of this tutorial, i can tell it might get long and/or complicated… i’ll try my best… here we go

FIRST, you’ll need the tools — download virtual pc (especially if you run windows vista) and then grab an image here — i would suggest getting the IE6 image, since that version of IE is the “worst” of them all
Read the rest of this entry »

wordpress: creating your own custom theme (part 2)

i feel that i should add a few notes as an addendum to my previous post — call it the “companion pack,” if you will

  • after you modify the “default” folder in the “wp-content\themes” directory, make a copy of it and rename it to something… anything…
    • i found this out the hard way. wordpress just recently did a string of updates (currently 2.8.2) and every time i’d do an update, my site would revert back to the default layout
    • luckily i had all my files locally so i was able to re-upload to the default folder
    • it only took me 3 upgrades to figure out that i had to rename the folder so that wordpress wouldn’t overwrite my work

Read the rest of this entry »

wordpress: creating your own custom theme

hot on the heels of my first tutorial, i come back at ya with a new one.

i REALLY like using wordpress as a cms — not only for its ease of customization or its extensive library of useful (mostly) plugins, but for these two huge reasons:

  1. ability for the end-user to modify the web site content without breaking the overall site geography
  2. search engine optimization — yea i kinda did mention them earlier, but several plugins can work to help your site get spidered like the best of them.

so i guess that answers the “why use wordpress?” question — here’s my method of getting a custom theme setup for wordpress
Read the rest of this entry »