jQuery is the only way… yeah!

For those that have not yet discovered the magic and power of jQuery, start now! This library allows you to write javascript with ease! It simplifies many of the complex aspects of javascript and allows you to quickly add some really cool funtionality to your web pages.

Since I use TopStyle for coding, I decided to take the time to make a jQuery Clip Library. It helps me write jQuery code faster in the editor. Download v1 for yourself!

I also made PHP and Miva (if anyone out there is still using miva) clip libraries a while back that are still available for download.

All 3 clip libraries should work in TopStyle v3.x. Don’t forget that TopStyle 3.5 is out if you have not yet upgraded!

No more IE6!

Remember back to when the web had Netscape Now and Get Internet Explorer buttons? Now you hardly see any website asking a user to use a specific browser. Why? We should though, because people are still using IE6. It is simply a terrible browser, yet us web designers have to code for it because many people are still using it. I can’t tell you how many times I’ve coded a site that works fine in: Firefox 2.x, IE7, Safari 3.x and Opera 9.x… but then, I check it out in IE6 and it doesn’t look right!

I say it’s time to bring back the buttons. Firefox Now, and Get IE7, or Opera Why Not etc. Lets get people to stop using IE6 and to start using the latest versions! As long as we keep supporting it, people will keep using it. It was fine back in the day to ask the user to use a specific browser, but now it’s a scary thing to do… or is it?

Upgrade to IE7, Firefox 2, Opera 9, and Safari 3!!!

Comment Notifier Plugin for Wordpress

When someone would comment on my clients blog, I would get the email to allow or deny the comment. I could simply ignore these emails, or forward them to the client. Rather than forwarding the email, what if I had the ability to add to the list of people receiving the comment notification?

Comment Notifier does just that very easily. Now I can put in my clients email so they can be notified about comments on their blog!

Extend Wordpress Part 3 - Templates

Today we’ll learn how templates work pertaining to categories and how to format those custom fields on our live site.

Categories Part A - ID Lookup & Create a New Page:
The first thing we need to do is to learn which id numbers go with which categories. Manage » Categories (in the WP Admin) will show you a list of your current categories and their ID numbers. In this example, we will take note of ‘Listings’ with the ID #3. If you navigate to this ‘wp-content/themes/default2′ directory (assuming you downloaded this theme from earlier and are using it), you will find a series of files including page.php. Open ‘page.php’ and save it as ‘category-3.php’. Where 3 is the category id number of the ‘Listings’ category in this example. We will be working on this new ‘category-3.php’ file soon, but first we need to grab a new plugin.

Part B - Install a New Plugin:
Download and install the Get Custom Field Values plugin. We will be using this plugin to display our extra data on our new ‘category-3.php’ file or rather our new Listings page.

Part C - Finding & Adding Code:
Find this line of code: <?php the_meta() ?> in your file and remove it. If you do not find this, make yourself some room right after this piece of code:

<?php the_content('<p class="serif">Read the rest of this page »</p>'); ?>

by entering some new lines.

Now we can add this code:
<?php echo c2c_get_custom('Price', '<strong>Price:</strong> ', '<span>|</span>'); ?>

Repeat this process for your other custom fields.
Your final category-3.php file may look like the following:

<?php get_header(); ?>
<div id="content" class="narrowcolumn">
<?php if (have_posts()) : while (have_posts()) : the_post(); ?>
<div class="post" id="post-<?php the_ID(); ?>">
<h2><?php the_title(); ?></h2>
<div class="entry">
<?php the_content('<p class="serif">Read the rest of this page »</p>'); ?>
<?php echo c2c_get_custom('Price', '<strong>Price:</strong> ', ' <span>|</span>'); ?> <?php echo c2c_get_custom('Location', '<strong>Location:</strong> ', ' <span>|</span>'); ?> <?php echo c2c_get_custom('Agent', '<strong>Agent:</strong> ', ''); ?><br />
<?php echo c2c_get_custom('Beds', '<strong>Beds:</strong> ', ' <span>|</span>'); ?> <?php echo c2c_get_custom('Baths', '<strong>Baths:</strong> ', ' <span>|</span>'); ?> <?php echo c2c_get_custom('Acres', '<strong>Acres:</strong> ', ' <span>|</span>'); ?> <?php echo c2c_get_custom('Status', '<strong>Status:</strong> ', ''); ?><br />
<?php wp_link_pages(array('before' => '<p><strong>Pages:</strong> ', 'after' => '</p>', 'next_or_number' => 'number')); ?>
</div>
</div>
<?php endwhile; endif; ?>
<?php edit_post_link('Edit this entry.', '<p>', '</p>'); ?>
</div>
<?php get_sidebar(); ?>
<?php get_footer(); ?>

Save this page and upload it to your the ‘wp-content/themes/default2′ directory. You should end up with something similar to the screen shot below if you navigate to this address…. ‘yoursite.com/category/listings/’

New Listing

 

Tips:

  • Visit this page to learn more about the Wordpress template system.
  • Make sure all of your new real estate listings are assigned to your ‘Listings’ category when you create a new post.
  • Make sure your new category-#.php has the same ID as your ‘Listings’ category and is uploaded to your current themes directory.
  • Your new code consists of 3 parts. P1 - the name of your custom field; P2 - the contents before the value of the field; P3 - the contents after the value of the field. <?php echo c2c_get_custom('P1', 'P2', 'P3'); ?>
  • Put your questions on the comment section of this post. You might have a similar problem or question that I can post the answer to!

Extend Wordpress Part 2 - Admin

In my first post, I went over how to extend wordpress using custom fields. Here in Part 2, you’ll learn how to make the custom fields look better on the admin side of things. This will make it not only easier for you, but for your clients and users as well.

Note: Since I last posted, Wordpess 2.2 was released. The techniques I’m showing you should work fine in Wordpress 2.1 or 2.2. With that being said, lets get started.

  1. Download and install the Custom Field GUI plugin on your site. (Don’t forget to activate it)
  2. Download this file, extract the conf.ini file and upload it to your wp-content/plugins/rc-custom-field-gui/ directory
  3. That’s it! You should now end up with the screenshot below when you go to write a post.

Wordpress Admin

 

It looks a lot nicer doesn’t it? Now you have form fields for price, agent, bedrooms etc. It is possible to create an an unlimited number of fields and the plugin also offers the ability to create dropdowns, radio buttons, and text area boxes. I simply made this basic one to show you what’s possible. Please comment with your suggestions so I may improve it the next time around.

Move on to Part 3 - Templates.