How to Properly Wrap Jigoshop Content in your WordPress Theme

There is a bit of a challenge when first using the Jigoshop eCommerce plugin for WordPress in a theme for newcomers. The trick is to properly replace Jigoshop content wrappers with the ones in use in your theme.

You would want to do this for most themes, as Jigoshop out of the box is only guaranteed to work with the twenty-ten theme. If you notice your sidebar(s) are below the products that Jigoshop lists instead of beside, then that is your first indication that you need the following.

You have to first unhook the ones in use by Jigoshop which are:

… and then hook in yours. The following are example containers and how to make them; you will need to analyze yours and replace them as needed in the first function. (more on this later)

You would place all of this code somewhere into your theme’s ‘functions.php‘ file; doesn’t much matter where but somewhere at the end before any closing ?> PHP tag is as good as anywhere.

So the hardest part is determining what your wrappers are and it’s been suggested to look at your ‘page.php‘ file. That assumes that your theme has one of course. Mine doesn’t, so ‘loop.php‘ might also be a good choice.

Generally, we will want the containers after the WordPress ‘get_header()‘ function call but this is also very theme dependent. If we look at the WP 3.2 new default theme, twenty-eleven, and it’s ‘page.php‘ file we will see:

So … to make Jigoshop properly wrap content for the twenty-eleven theme, we need the ‘primary‘ and ‘content‘ div’s. These are ID div’s, some may just be CSS class’s as my first function above uses.

My first function above to open content for twenty-eleven becomes:

… and since we are only opening 2 div’s, then we only need to close 2 in the second function to close the wrappers. There, you would remove one of the closing div tags so that there are only 2.

Hope this helps everyone.


Working with the Jigoshop eCommerce Plugin for WordPress

I have spent some of the past few weeks familiarizing myself with the Jigoshop eCommerce plugin for WordPress. While there are a few eCommerce solutions for WordPress available, Jigoshop is a relative newcomer on the block and is in fact still a beta product that will very soon hit 1.0 status. As Jigoshop sits now though, it is already as capable as any other eCommerce solution available and is quickly garnering attention as the premier go to online Store solution for WordPress.

You can very quickly set up a variety of products in your store including digital, physical and services. There are features for managing orders, promotions and coupons, with product filtering and sorting. There are widgets for displaying new, featured and related products for cross and up selling. Customers and visitors can enter product reviews with a rating system. There is a customer account area, multiple shipping options and currencies, tax by location, inventory management and tracking, grouped and configurable products, customizable email receipts, sales reports, product export … the list goes on.

There are several payment gateways available including Paypal standard and express, Google Checkout, SagePay, and Moneybookers with more under development.

Jigoshop provides basic theme look and feel for the TwentyTen default WordPress theme and looks pretty good out of the box. You can customize styles using your theme stylesheet and modifying the Jigoshop frontend.css, but for maximum banding of your store you will need to make use of the built-in action hooks and templates to customize the look and feel to match your brand and there is a friendly support forum on the Jigoshop site to help you do this.

For your regular posts and pages there are a variety of shortcodes available for displaying products in other areas of your site to help you increase visibility for your store.

Jigoshop will impose some minimum server requirements such as:

  • A WordPress installation
  • PHP 5.2.4 or greater
  • MySQL 5.0 or greater
  • The mod_rewrite Apache module
  • fsockopen support (for payment gateway IPN access)

Jigoshop is a fairly complete shopping experience for your online sales and I believe it will become the standard that all others will have to follow. While it scales very well, it is an excellent choice for a small and medium-sized business shopping cart. You can get a brief overview from the following video and visit Jigoshop to view an online demo store and get more information.

Oh yes, like WordPress … it is also free.


WordPress Bookmark Short Code for Links

Here is a useful little WordPress shortcode that some might find helpful. It is a ‘bookmark’ code for accessing links in the Link Manager of WordPress from within your posts or pages. WordPress shortcodes are handy post editing tools to speed up the writing process, especially for something like links that require a fair bit of HTML coding. Using a shortcode can allow you to get consistency in your link output throughout your posts for regularly used links.

Place the above code in your functions.php file and then from within your posts you can use something like:

NO BOOKMARK FOUND for ID = 293 is great blogging software!

and your final post output complete with title popups will look like:

WordPress is great blogging software!



How to Setup Postfix for Mac OSX and WordPress PHP Mail

I have been running a self hosted website off of my own computer for awhile now and wanted to use the Fast Secure Contact Form Plugin for WordPress. The problem was while the Apache web server was up and running along with PHP and MySQL to handle the back end for WordPress, there was no Mail Server for FS Contact Form to make use of.

Sendmail and Postfix are installed by default on a Mac OSX distribution although disabled by Apple. There are a variety of setup examples on the net; some useful, some not so. It took some tinkering, more than it should have in fact, so hopefully this process that I went through will help someone else.

Postfix will require some setup and one of the better instructions for doing that comes from Brett Hutley’s Blog. So armed with that I fired up the Terminal and went about editing ‘/etc/postfix/‘.

sudo nano /etc/postfix/

I use nano or pico (same thing) on occasion and am comfortable with them, but if you prefer emacs or vi go for it, but I mostly use the command line tool for TextWrangler named ‘edit‘. If you download and install (free and excellent text & code Editor with syntax coloring for the Mac) and install the command line tools with it, then ‘sudo edit filename‘ will open the file in TextWrangler so you can do your edits there. Way Cool.

I then put all of the following including comments for future reference at the End of /etc/postfix/

So far so good, and after following Brett’s instructions for generating the sasl_passwd and setting permissions, I launched PostFix:

sudo postfix start

… and the mail.log was filled with missing directories in the /private/var/spool directory. I tried creating these as they appeared and then permission errors were encountered. Attempts to set owner and groups got a little farther, but no joy, until after more research I discovered the following:

Well, well. All necessary directories in place and properly configured and a test gave expected results.

telnet localhost 25

This showed access, but then the connection was dropped as my ISP blocks port 25 for SMTP.

date | mail -s 'test email' my@email.addy

This worked as expected and it was forwarded to my GMail account as the instructions in /etc/postfix/ had dictated.

The next thing was to make this permanent between reboots and we need to:

We copy the file out of the System folder as we really shouldn’t be editing anything in the System Folder as System Updates can and will overwrite them.

Next we ‘ sudo edit /Library/LaunchDaemons/org.postfix.master.plist ‘ and add the following just before the closing ‘ /dict’ tag:

I don’t require Postfix to be running all the time; only when the Contact Form on my website is used so I chose these options. You can of course change either to ‘true’ depending upon your requirements. We can then start this up by either rebooting or using ‘launchd‘ with:

Back to WordPress and the FS Contact Form plugin. Test emails with that on my site were now giving errors and after more research the specific error was ‘Could not instantiate mail function’ and the Mail.log in was complaining about needing a -t switch for email Recipients or else Recipients must be issued from the command line. FS Contact form was passing information to sendmail correctly it seemed, and command line use was out of the question so more digging revealed PHP ‘mail’ needed one final change to ‘sudo edit /usr/local/php5/lib/php.ini‘.

Edit the php.ini file and search for ‘sendmail_path‘. Change the line that is there by adding the -t switch so that the final line looks like this:

sendmail_path = /usr/sbin/sendmail -t

Save the changes and now we need to restart the web server with:

sudo apachectl restart

And FINALLY … a test mail sent with the FS Contact Form plugin within WordPress running off of my web site hit gold!

I need a drink and a pill …


How to Manage WordPress 301 Redirections Without Modifying Apache

Urban Giraffe has a great WordPress plugin I wanted to share with you. Have you ever set up your blog and then thought that the permalink structure you had chosen was not what you really wanted? Or perhaps you titled a post and then later thought better of it and wanted to change the title and perhaps the corresponding post slug? For these and other reasons, you need a tool that won’t break your incoming links to the new permalink structure or title and post slug change.

Redirection has been running on my site for awhile now and I have found it to be a great tool for permalink structure changes as well as post slug modifications among other things. From the Urban Giraffe site:

The main idea behind Redirection is that you create several URLs that you want to redirect. These URLs are placed within a group, which in turn is placed within a module. The module determines how the URLs are redirected, and the group allows you to logically organise the URLs.

On one occasion I had posted a topic only to discover the next day after Google had indexed it that it had a spelling mistake in it. Simple post slug change and add a redirection request to Redirection and problem solved. I had also changed my permalink structure some time ago and after other sites have indexed or linked to you pages, they are still using the old links and were hitting 404 not found errors. Add a few lines into Redirection and problem solved; the users were now redirected to the new URL’s on my site.

There is a complete logging and statistics section to the plugin so that you can monitor how many times a URL has been redirected as well as 404 error integration allowing you to monitor the log and map out 301 redirects based on the errors. These and other features are documented on the Urban Giraffe website.

It’s a great little tool and I highly recommend it. Thanks Urban Giraffe!

DivergeTowardsInfinity. © 2006-2011 All Rights Reserved.