Archive

Posts Tagged ‘WordPress’

Aptana, the only IDE you’ll ever need for web development

January 30th, 2009

aptana-site-screenshot.jpg

If you work with WordPress or any other CMS platform there will undoubtedly come a time when you need to modify the template files to suit your own needs. Off the shelf templates are a great starting point, but there always seems to be something that could work better if it was tweaked just a little or look a lot better if just one or two little nudges were made to the layout.

If you’ve ever tried modifying the template files in the built-in WordPress theme editor, you’ve probably already run into some pretty significant issues, such as lack of error checking, wonky layouts and poor handling of php code. Editing themes in this manner is nothing short of nightmarish, even for seasoned developers. Another option is to use a decent desktop text editor such as BBEdit for Mac, CodePad for Windows based systems or Gedit or Kate for Linux, but these editors are still lacking in fundamental features that developing in php requires, such as code completion and advanced syntax checking that can keep you from accidentally causing your entire site to go offline due to a missing semicolon or open tag.

Enter Aptana Studio, the only editor you’ll ever need to download. Not only is Aptana rich in all the features that you might need to get your themes and templates up to speed, including syntax checking, code tidying and code completion, but it’s also available in versions for Mac, windows and Linux, which means that even if you work on multiple platforms as I do , you will be working in a nearly identical editing environment on each computer you use, which can increase productivity exponentially.

While Aptana is incredibly feature-rich in the area of code editing, the lack of a WYSIWG editor may be a put off for novice users. My advice in this case is really a preference, but I honestly feel that code should never be edited in a WYSIWYG environment. Visual editors have a nasty habit of reformatting your code. Even the venerable DreamWeaver does so on occasion and these changes can be a nightmare to find and repair if you haven’t noticed them very quickly. Also, if you’re developing template files for a CMS, a visual editor isn’t going to do you much good anyway, as the editor does not have the ability to actually run the code that displays the template.

Aptana shines in other areas of development as well. If you’ve ever wanted to develop an iPhone App, you can with Aptana. The iPhone plugin even supplies a virtual iPhone browser so that you can do preliminary testing in the IDE, not on your iPhone. Once you’ve gotten things working the way you’d like, just install the app. Aptana also offers full support for Adobe air development, Ruby on Rails, Python, and Nokia phones.

Forget your FTP software. Aptana’s built in project manager handles file uploads and full site syncs with ease. this feature was what set DreamWeaver above most other editors, but Aptana Studio has tackled this head on with one of the most robust remote toolkits I’ve seen.

If you’ve been looking for a good, solid, robust and reliable development IDE, Aptana might just be the one you need to look into. The professional edition does come at a cost, but unless you work as part of a large development team, i doubt you will ever need to use the features provided by Aptana studio Pro. The Free Standalone edition will work just fine for you.

But hey, I’m just a satisfied customer. I love Aptana so much that it’s installed on every one of my computers. (though it is mind numbingly slow on my micro-notebook). Everyone has their own personal preferences in a development environment. I know people who happily develop web templates using Microsoft Word, though why in the world they would do that is far beyond my capability to understand. (And their sites rarely work properly.)

Try Aptana for yourself. I really do think that you’ll fall in love with it. And just in case you’re wondering, no one is paying me to write this. I’m an Aptana evangelist and I’m on a mission to get everyone who has ever needed to work on a php file to give it a shot. The more people that use it, the better it will become, as the developers will have more motivation to build bigger, better, badder versions of the software.

That’s all for now kiddies. I’ll get back on the ball and get more posted in the next few days, now that I’ve shaken the funk that I’ve been in through most of the Holidays. There were a lot of reasons for it, but I’m back and I want o start the new year of with a bang!

Jerry Productivity, Tools of the Trade, WordPress, WordPress Themes , , , ,

Running WordPress? Wait for Flash 10

November 11th, 2008

If you’re running a WordPress powered blog and like the functionality of the flash image uploader, you might just want to wait to upgrade your Flash Player.  Flash Player 10, which is shipping now causes the flash uploader to break.  There are no fixes at this time.

On the other hand, if you’ve suddenly lost the use of your flash based uploader and the symptom is that when you click the button nothing happens at all… Then you’ve probably already got Flash 10 installed.  Don’t worry, you didn’t break anything, just sit back, use the browser based uploader for a bit and wait for WordPress 2.7, which should be shipping in a few weeks.  From what I hear, they’ve got a fix going in that will get your nice pretty multiple file upload capability back for you.

At least I hope so, because I’m tired of having to upload them manually.

Jerry WordPress , , ,

Modifying Mimbo 2.2: Step Two – Modifying index.php

July 27th, 2008

This is the second in a series of articles that will cover making several modifications to the Mimbo 2.2 Theme by Darren Hoyt.  I am modifying the theme to fit the requirements for my own site.  To see the first step requirements and get an overview of what I have planned, please read The first article in the series; Modifying Mimbo 2.2: Step One – Identifying Requirements

Without further ado, let’s dive into the code for Mimbo’s index page and make some changes.

As mentioned in the first article of this series, one of my first requirements is to use category names to pull posts out of the DB instead of the default setup used by Mimbo.  This isn’t a complicated change, but when there is the possibility of category ID’s Changing over the course of a development cycle, it’s one worth making.  To make this modification, we first need to find the section of code that calls Lead Story and modify it to suit our new requirements.

Again, this is where Mimbo shines, since we find the first module right at line 6 of the index.php file:


    " alt="" id="leadpic" />

{More»}

Line 8 is the one we need to take note of.

query_posts('showposts=1&cat=3'); ?>

This call uses the query_post() WordPress Template Tag to get 1 post from category number 3. What I want to do is get the category information by name, in this case, I want to display the latest post in the “Recipes” category, so we’ll change it to read as follows:

query_posts('showposts=1&category_name="Recipes"'); ?>

The next call to a category ID is at line 16, where the category title is displayed:

// this is where the name of the Lead Story category gets printed
wp_list_categories('include=3&title_li=&style=none'); ?>

Unfortunately, wp_list_categories does not allow for calling categories by name, But since we’re already specifying the ctegory that we want by name, we can actually eliminate the need for a php call and simply print out the name using standard html, like so:

// this is where the name of the Lead Story category gets printed
?>Recipes

In the case of the project I’m working on I don’t think it’s necessary to print anything at all, since it’s going to be pretty obvious that what the reader is looking at is going to be a recipe, so I’ve made the following changes, starting at line 13:


Note: I’ve only commented these lines out in the example so that line numbering is not affected. In my production site, I removed them from the code altogether.

The second change needed to match my requirements is that all posts must show author information and date posted. This is required by several of my advertisers so that they can keep track of the dates that ads and reviews were posted. I really like to keep the people that make me money happy, so I’m going to add it in.

I want the author and date information directly under the title of the post, so I’ll start adding it in at line 19:

Original Code:

// this is where the title of the Lead Story gets printed
the_title(); ?>

And we change it to:
// this is where the title of the Lead Story gets printed
    the_title(); ?>

    By   •  • Category: 

What we end up with is this:

The layout works, but it's not pretty. It'll look better once images are added and a little css work is done

As you can see, we now have no category title and we've got author information posted below the post title using the <small> tag. It's ugly as heck, but all that will be fixed later when I modify the stylesheet to fit the look that I want. What we've got is working, and I call that so-far so-good. At this point we need to modify the second column to work in the same manner. Since we've already covered the changes needed in detail, I'll just show you the code before and after modification, you should easily be able to spot the changes: Original Featured Column:


Modified Featured Column:

Recent Recipes

The only real difference between the first examples is at line 36 of the modified code:

    query_posts('showposts=5&category_name="Recipes"&offset=1'); ?>

Take note of the offset parameter. Since we're using this column as a continuation of the Recipes category and we've already displayed the first, or newest, post in the category, we use the offset parameter and set it to 1. This tells query_posts() to skip the newest post in this category and move on to the next, thus avoiding a duplicate entry.
The other main addition to the original Mimbo code is that I added post excerpts to the second column so that my readers get a glimpse, or teaser, of what the post contains. I've found that this can, at times, persuade a casual passerby to move a little deeper into the blog to find what he or she needs, and again adheres to the requirements of some of the companies that pay me to do what I do.
Modifying the third column is much the same as the first two. with just one exception. By default Mimbo uses an array of integers to get the first post in any number of categories specified and display them in that column:

I just switched the code up a bit to use category names so that all the sections matched:
// this is where you enter the IDs of which categories you want to display
$display_categories = array("Reviews","Product Spotlight", "Blog Events", "Shopping Alerts", "Blog Spotlight");
foreach ($display_categories as $category) { ?>
all I did was change the array to hold category names instead of ID's. After that, changing just the "cat=" parameter to "category_name=" was enough to let the theme do the rest. Easy Peasy! I think that's enough to digest for now. In the next article I'll address modifying the way Mimbo handles images on the main page. Have fun coding!

Jerry WordPress Themes , , ,

Modifying Mimbo 2.2: Step One – Identifying Requirements

July 21st, 2008

The time has come for a major revision to my cooking and recipe blog and I’ve chosen Mimbo to act as the basis for the redesign.  This is the first in a series of articles that will detail the changes I’ve implemented to get Mimbo working the way that I need it to.

There are few WordPress themes that have garnered as much interest as Mimbo 2.2 by Darren Hoyt. Not only is the layout elegant and very functional, the code is commented well enough to allow anything from minor tweaks to major customizations without much trouble at all. This ease of customization is a major component to Mimbo’s success and in my opinion it is also Mimbo’s strongest point.

As with any theme modification, steps need to be taken in advance to know what your requirements are.  In this case, Mimbo’s layout is nearly everything that I want for the new look, but there are some very real changes that I need implemented.  Styling is almost always a more significant time investment, so it’s best to decide early on if the project will have to be switched to another theme. Before worrying about new header graphics of mucking with CSS styles, it’s necessary to map out the core functionality necessary for your specific needs and make sure that everything is functioning in the way that you need it to. This can save hours in development time.

With that in mind, let’s look at the way that Mimbo functions “out of the box”.

Darren Hoyt's Mimbo. As a theme, it's a work of art

Mimbo has four main “Modules” on the index page. (The sidebar has multiple modules, but I’ll focus on those in a later post) Each of these modules displays the latest information from different defined categories in whatever order the blog owner prefers. Let’s look at each in turn and see how the theme author has this laid out.

  1. The Lead Story Module: Designed to handle important news, or the most relevant piece of “core content” of your blog.  It puts it right out there in front of the world at twice the width of anything else on the page.
  2. The “Features” Module: a chronological listing from the “Featured” category.  Generally the column where important “bread and butter” articles would be featured.  Again this targets your core content, but it’s content of a less immediately relevant nature than the Lead Story.
  3. The Right Column Module: The right column module displays the latest article posted in any number of assigned categories.  This is really the feature that puts Mimbo firmly in the “Magazine Style” WordPress theme category, and it is a very powerful tool which shows the casual visitor a brief overview of the topics you’ve been covering.
  4. The Sidebar Module: Mimbo’s sidebar contains all of the usual suspects for a WordPress theme. It has Widget support, categories, and recent this-or-that in place right out of the box.  It also has a few custom pieces like another module for displaying very short snippets of site news and advertising space built in, which just ads another level of power to this theme.

If you’re just looking for a theme that looks great and works flawlessly, Mimbo is good right off the shelf.  Unfortunately, it’s almost never that simple. Every blog or website has its own special requirements and even as good as Mimbo is, it’s just not quite what I need at this point.

The first change I need to implement is in modules 1 and 2.  For my needs, both of these modules needs to display information from the same category. They also need to display the date the post was published and a few other bits of information, such as a spoiler (or excerpt) and author information.

Module 3 is already set up much the way I need it, so the basic functionality does not need to change, but there are some formatting issues that need to be addressed. As with Modules 1 and 2, I need the date published, a better excerpt and author information shown on the main page.

In addition, I want to change the way Mimbo handles some of it’s main display functions to better suit my work flow and the fact that I’ll be importing a live site into a test environment more than once during the build process. This could change the category ID’s on me while I’m testing, and that’s just not a great way to play.

In the next installment, I’ll dive into the code changes necessary to accomplish this first round of goals.  Hopefully it will give a better understanding of theme tweaks in general and allow those of you who have always wanted to mess with your theme files to take the leap into true customization.

For my more experienced readers, perhaps it will persuade you to play around with Mimbo and see if it suits your needs as well.

Until next time!

Jerry WordPress Themes , , , ,

The Better Feed Plugin – Your Feed on Steroids!

July 15th, 2008

If you’re a long time WordPress user like myself, you may have gotten used to using the  <!– more –> tag to display teaser material in your RSS feeds.  If so, the decision to remove support for this feature in the 2.5 release of WordPress may have had you a bit put off. Since WordPress 2.5, you either had to go with full feeds, (Not good in cases where traffic to your blog = money) or you had to fill in the description field for each and every post.  (Honestly, if I wanted to use Joomla! I would have been doing so already!)

Enter the Better Feed plugin from Ozh.  Not only does this bad boy return you to the stock behavior of earlier WordPress versions, but it allows you to add just about anything you ever thought of to the footer of your RSS feed. How about Post word counts, custom (Read More) text, number of comments, a nice little reminder that you’re running a contest?  You name it, this plugin will do it.

I’ve used several plugins over the past few years that added advertising to my RSS feeds, but none of those solutions was very elegant.  Better Feed makes this process simple.  Each time a new round of advertisements that I feel my readers would be interested in comes through my inbox, I simply append the best of them using the plugin interface, hit save and forget about it until next week.  No more worrying about whether I’ve fubar-ed the code for one of five rotating ad choices or mucking with a management script designed to handle far more than I will ever need on a C-list blog. (I’m working at hitting th A-List, but hey, it takes time!)

There is a bit of a learning curve to Better Feed, but It’s nothing that should send you into a fit.  The tags are pretty straightforward and the editor will be familiar to anyone who has ever edited their comments before.  Getting things to look just the way you’d like may take a bit of time, but you’ll get there, don’t worry.

In the end, I’m listing this as one of my “Must have” WordPress plugins.  I just don’t know what I’d do without it at this point!

Jerry WordPress, WordPress plugins ,

ss_blog_claim=3928b73221a2ea923abbd6c5cb76831e ss_blog_claim=3928b73221a2ea923abbd6c5cb76831e