WordPress Wednesdays: Setting up Default Settings for FTP in WordPress

Now that you are using WordPress 2.7 or WordPress 2.8 and are updating your plugins when new updates are available using the WordPress admin – you might be tired of entering the same information over and over (FTP host, FTP user, and FTP password). If you want to just have the WordPress admin automatically connect and not prompt you for these items – you can enter the following in your wp-config.php file and you will set from then on to update plugins without having to remember all the info.

define(“FTP_HOST”, “jappler.com”);
define(“FTP_USER”, “user”);
define(“FTP_PASS”, “password”);

* Please note that this is not personally recommended that you have your FTP credentials in any script for security reasons – but this is something you can at your own risk and something that does save some hassle (but can come with a price).

WordPress Wednesdays: Where to Begin

A lot of people want a web site or a blog but do not know where to start or what all WordPress has to offer. If you are looking for a great, easy to use system to publish content on the web – I would start here:

  1. Start Free. If you want to simply check out WordPress and see what is made of – sign up for a free account at wordpress.com You can choose from several free themes (look and feel) and have no worries about backup, hosting, etc. This will allow you to focus on the content and not get frustrated with installation/set up and hosting.
  2. Read. Take 10 minutes and read through some of the documentation.
  3. Play Around. Familiarize yourself with WordPress widgets (sidebar) and start taking control of your content.
  4. Customize. Once you are ready to move your site to a host so you can customize your theme, your plugins, etc – start looking at some free plugins before doing any custom development. It is most likely you will be able to find something free that fits your needs.
  5. Add. Check out the themes and plugin listings on wordpres.org (Extend).
  6. Learn More. If you get to a point where you have a site up, you have content, and you want to find out more about what all WordPress can offer – I would suggest either buying a WordPress book or pay for an hour of consultation with a company that specializes in blog consultation (like my company) so you can really maximize your web site presence and efficiency.
  7. Small Steps. Most importantly – start small and build on it. Blogging and maintaining a web site is not always fun or easy – but taking small steps (one new plugin at a time, or a slight change in a template) will ensure your web site will continually develop into something great!

Just remember – you do not have to be a graphic designer or a programmer to have a great web site – you just need patience and a willingness to learn!

WordPress Wednesdays: It is All About the Query

My last ten or so projects I have been working on all have a common theme: maximize WordPress’s ability to be a powerful CMS. Clients more and more are coming to me with the need to create a custom fields which they can store/query data throughout their site.

WordPress is completely customizable and because of this – it is easy to add custom fields to any post or page and then use the data put in them throughout the page.

Example: You have all your clients listed on your web site – and have created profile pages for them. Not only do you want to show their profile – you would really like to have a page template that shows all your client logos – and does so dynamically so that anytime you add a new client – their logo gets added to the mix automatically. The examples are endless and the solution is easy.

Step 1: Create a custom fields plugin (or use the generic custom fields) – personally I like to create a plugin so that I can completely customize and make adding content as easy as possible. If there is interest – I can cover how to create a plugin.

Step 2: Now that your data is stored – you can use it anywhere you want (in the loop, outside the loop). You can use something like:

ID, $key, true);?>

to display the data. (see Using Custom Fields for more information).

Step 3: Again – now that the data is stored – you can also query it so if you wanted to show all logos (as mentioned above) – you can do so by using WordPress’ query_posts to query and then display the data. (see Query Posts for more information).

Stuck? Interested? Let me know.

WordPress Wednesdays: Take Control of Missed Spam

Even with Akismet, and http:BL installed to stop spam – I still get the occasional spam comment. Until a few days ago, I simply got frustrated, went into the WordPress admin and then marked them as spam.

Spam Keywords

Then after thinking about this more, I remembered you could actually enter in your own text pattern that WordPress would use to mark comments as spam or block the comment completely. All the spam that was coming through – all had the same text in it (a series of question marks) so I added that into the “Comment BModeration” box to make sure that they were being caught appropriately – and after a week or so, I will then move that pattern down to “Comment Blacklist”. So – if you are like me and see some spam still slipping by your spam protection, take advantage of the two options to add in words, email addresses to block/send to moderation, under “Settings > Discussion”.

WordPress Wednesdays: The Power of Self Publishing

Having a blog or CMS that uses something like WordPress is a great way to easily publish content and is very easy for people who have no understanding of HTML, images or design but this power comes with a double edged sword.

On one hand, anyone can quickly upload images, video, and write text…even add some floating elements (picture on the left, picture on the right) without seeing any code. While this is great for most people, when something goes wrong (unclosed HTML tag) this can wreak all kinds of havoc on a site. I often get questions like “why is my entire blog in bold” or “what happened to my sidebar – it is now under the content. I even get people who look at my portfolio and email me about “you might want to fix this site because x is all messed up”.

While self publishing is great because it gives the writer all the power – it is also problematic because…it gives all the power to the writer. With this power – comes responsibility. If you want your business or personal image to be based on what people see on your web site – please take the time to learn some basics. Images look best at x size in this spot…this is how I bold something…etc.

As a web developer – I give my clients guidelines and do a lot of defensive programming to try and eliminate anything that I can foresee as being an issue – but please remember – while systems like WordPress easily allow you to publish your content – it also easily allows you to publish sloppy content.

There is a reason why most large companies have entire departments that control what goes out to the public with complicated review systems in place. So if you want to take advantage of something like WordPress, remember that you have all the control – both good and bad. If you see a site in my portfolio that looks skewed – know that the client would not allow me to hand that over to them like that. It is like that because they have complete control over the content. 😉

WordPress Wednesdays: All Posts in a Parent Category

The need to show all posts in a particular category or that category’s sub categories is very high. There are not too many projects out there that do not require a customized search, a menu, or a listing of some sort where the user wants to include all posts (or exclude) that belong to a parent category. Until recently – there was no real good way to do this. You either had to hard code category names or IDs in an array, or get really creative.

I recently started using the following function mentioned in the WordPress Codex that made this very easy: post_is_in_descendant_category().

By using that function – you can test to see if a post is in a particular category or even several subcategories deep of that category and then use that to easily show exactly what you want.

Examples and documentation for post_is_in_descendant_category: http://codex.wordpress.org/Template_Tags/in_category

Side Projects

Between normal day to day work, maintaining a house, spending time with the family and pets, exercise, relaxing, and enjoying life…there is not too much time for fun side projects these days. I have been trying to complete a few really cool things over the last few months without much luck…but I think March will be a big release month. I have some cool WordPress plugins, templates, and an interesting little project in the works – so assuming I can get some time…look out! Stay tuned…

Show One Post/Page in WordPress

If you want to have a content area somewhere on your site that shows content from a post or page – and you want to do this with using the simplest of code (no loop, no query_posts, etc), check out the function get_post. The get_post function allows you to simply get one post’s title, content, category, etc by simply adding a few lines (see the example in the documentation) of code to your site. I have used this on a number of client’s sites as well as recently on my company site for the company profile. Keep it simple!

Quick CSS for WordPress Images (Updated)

A week or so ago, I posted some information on how to quickly style your WordPress images. After recently updating my company’s web site (SDAC Inc. – I noticed if you used captions, my custom CSS would not work. Here is some CSS that will work with and without image captions:

.alignright, .aligncenter, .alignleft {padding:4px;background:#ecece2;border:1px solid #c7c7bb;}
.alignright {float:right;margin-left:5px;}
.alignleft, .alignnone {float:left;margin-right:5px;}
.aligncenter {display: block;margin-left: auto;margin-right: auto;}

The difference? I used img.align.. which worked if you did not use captions, but if you use caption, there is an outer div class called align… The more generic CSS posted here takes care of both issues.