FS-Contact-Form-Screenshot-1

There are plenty of contact form plug-ins for WordPress.  I’ve used a few that I thought would be good but turned out to be barely functional, clunky, and/or buggy.  There are a couple of very reliable and simple to customize contact forms, however.  I have deployed numerous sites that need to handle multiple types of contact forms and have been impressed with the reliability of one in particular called “FS Contact Forms”.  The “FS” is short for “Fast and Secure”.  It has a very simple interface and with a single short code you can deploy your contact form.  It has built in validation, Captcha, integration with third party scripts, and best of all, it seems to always work as expected — another feature many WordPress plug-ins seem to lack.  The instructions for creating multiple contact forms in pages, posts, and even widgets are extremely easy to follow.

It is recommended to rely on the WordPress community regarding the reviews and the number of downloads a plug-in receives, this is usually a pretty good indicator of its reliability.  You will see these results when you search for new plug-ins.  I sometimes wish that you can sort and filter plug-in results better — I’m sure there’s a plug-in for that, too! So if you are looking for a reliable solution and you have a need to deploy one or more custom forms that can also accommodate file uploads, this is the best WordPress plug-in that I have come across.  The interface also allows you to integrate seamlessly into Constant Contact, though I have not explored this option, they probably have something in common — what that is is no concern of mine I’m just reviewing a product based on the merits of its performance.

As it stands, I haven’t come across a better plug-in with as many features that has been deployed so reliably as “Fast and Secure”, so if you are looking for a simple solution to deploy your custom forms, just search “FS Contact” in your WordPress admin “Add New Plug-ins” page, or visit their website at:  http://www.fastsecurecontactform.com/


The WordPress Genesis framework is an excellent and reliable source of themes designed around a proprietary framework from StudioPress.  You can’t use any Genesis themes without buying them, but you’re not just buying a theme, you’re buying access to their framework, which in many ways makes a lot of WordPress functions and customizations easier while sometimes making certain customization more work than the standard WordPress workarounds.

In the below code example,  ‘cat’ is used as the category ID.  You can also access the global object wp_query:

  • cat (int) – use category id.
  • category_name (string) – use category slug (the end child URL of the category)
  • category__and (array) – use category id.
  • category__in (array) – use category id.
  • category__not_in (array) – use category id.
<?php
/**
 *
 * Template Name: Custom Category 1
 * This file modifies the genesis loop
 *
 */

remove_action('genesis_loop', 'genesis_do_loop');
add_action('genesis_loop', 'custom_cat_loop');

function custom_cat_loop() {
    global $query_args;  // wp_query() args
    $args= array('cat' => '11');
    genesis_custom_loop(wp_parse_args($query_args, $args));
}

genesis();

?>

StudioPress backs their themes and framework and has excellent support.  Their themes are very reliable, I have updated a few Genesis frameworks and their related plug-ins never without an issue.  Under the hood, they are encapsulated, mostly object-oriented, so they’re not prone to those fatal errors and other weird things that may happen when loading plug-ins and themes from other sources.  WordPress is funny that way — they don’t have very high standards for code conventions and quality, so you need to rely on the WordPress community’s reviews, ratings, and actually see how popular the theme or plug-ins are.  You may find a diamond in the rough, and by all means explore the other options, but StudioPress takes the guess work out of “will this break everything?  Will it crash my site?”

If you’re in a dev environment and experimenting, that’s one thing.  If you’re on a tight deadline to launch a site, that’s another.  Go with the tried and true.  I personally love the Twitter Bootstrap framework because it is light weight, fully responsive, and has so much flexibility right out of the box, but StudioPress does a great job building responsive into many of their themes out of the box as well.  They do their homework, so unlike some independent themes you may buy for WordPress, StudioPress offers a wide variety of themes at very affordable prices.  There is a learning curve if you decide to go with StudioPress, but if you’re not planning on too much customization with your website, your StudioPress theme will accommodate most of your needs without delving into the cod, building your own templates, or refining custom loops.  That is, until your art director gets involved…. 🙂


This handy query will return all the post IDs from all your WordPress posts that are exact duplicates.  I usually run this query in a loop and then will delete the newest post duplicate.  This problem usually comes from multiple users importing content into the new WordPress site or importing content from Joomla into WordPress without cleaning the data first.

I go by post content and not just titles, this is a good idea if you have more than 500 articles since there would be a high likelihood that some titles may match but the actual content of those matching title posts could be the same.  This ensures your website does not have duplicate content, which not only will help with your website performance and improve organization of your site, it could drastically improve your SEO rankings since all URLs and content on your site are unique.


//MySQL query -- posts_table is your WordPress "posts" table

SELECT ID FROM posts_table
JOIN (SELECT post_content FROM posts_table
GROUP BY post_content having count(*)>1) dupe
USING (post_content)

Even though there are thousands of plug-ins for WordPress that could accomplish many tasks, I have found that installing a plug-in to perform certain maintenance functions and other admin tasks are cumbersome and unreliable.  The WordPress database structure is very simple and straight forward and it is recommended to try to use single-line database queries that could accomplish the same thing without burdening your website with plug-ins that will slow down your website and cause possible conflicts with the plug-ins you already have installed.

Even for routine maintenance, it is a good idea first to consider running and testing a script that can interface directly with your WordPress database and set up a scheduled CRON job than install another plug-in to perform the same tasks.  Avoid relying too heavily on WordPress plug-ins!  You have been warned!!!


These are pretty standard settings, simply lines entered in your site’s root .htaccess file.  Be careful modifying your .htaccess file, if you don’t know what you’re doing a rogue semi-colon (;) could easily take your site down and throw that dreaded “500 Server Error” — that’s not the kind of error you want your website to get, but even though a 500 error looks bad, it’s amazing how you can bring a site down so easily with a simple character or a single line of code in many types of scripts.

An “.htaccess” file isn’t really a script, though it can contain behaviors and conditions, it’s more a set of directives that let the server know what you want it to do and how it can act.  Since it’s so powerful and does so much, with great power comes even greater responsibility. Keep in mind that you should be testing these directives on a “dev” server (development server) and not your live site!  Also these lines are generally accepted, but your flavor of Linux might require a different approach or modifying the settings and commands to work properly on your particular server.


<ifModule mod_gzip.c>
mod_gzip_on Yes
mod_gzip_dechunk Yes
mod_gzip_item_include file \.(html?|txt|css|js|php|pl)$
mod_gzip_item_include handler ^cgi-script$
mod_gzip_item_include mime ^text/.*
mod_gzip_item_include mime ^application/x-javascript.*
mod_gzip_item_exclude mime ^image/.*
mod_gzip_item_exclude rspheader ^Content-Encoding:.*gzip.*
</ifModule>

#Gzip
<ifmodule mod_deflate.c>
AddOutputFilterByType DEFLATE text/text text/html text/plain text/xml text/css application/x-javascript application/javascript text/javascript
</ifmodule>
#End Gzip

# More optimizing

# BEGIN Expire headers
<ifModule mod_expires.c>
ExpiresActive On
ExpiresDefault "access plus 5 seconds"
ExpiresByType image/x-icon "access plus 2592000 seconds"
ExpiresByType image/jpeg "access plus 2592000 seconds"
ExpiresByType image/png "access plus 2592000 seconds"
ExpiresByType image/gif "access plus 2592000 seconds"
ExpiresByType application/x-shockwave-flash "access plus 2592000 seconds"
ExpiresByType text/css "access plus 604800 seconds"
ExpiresByType text/javascript "access plus 216000 seconds"
ExpiresByType application/javascript "access plus 216000 seconds"
ExpiresByType application/x-javascript "access plus 216000 seconds"
ExpiresByType text/html "access plus 600 seconds"
ExpiresByType application/xhtml+xml "access plus 600 seconds"
</ifModule>
# END Expire headers

# BEGIN Cache-Control Headers
<ifModule mod_headers.c>
<filesMatch "\.(ico|jpe?g|png|gif|swf)$">
Header set Cache-Control "public"
</filesMatch>
<filesMatch "\.(css)$">
Header set Cache-Control "public"
</filesMatch>
<filesMatch "\.(js)$">
Header set Cache-Control "private"
</filesMatch>
<filesMatch "\.(x?html?|php)$">
Header set Cache-Control "private, must-revalidate"
</filesMatch>
</ifModule>
# END Cache-Control Headers


SEO experts encourage their customers to ensure every image that displays on their website have alt tags with meaningful and descriptive text.  This will help with SEO.  So, what should you do to improve your rankings in the meantime.  Perhaps you have hundreds of images and this will take some time.  Well, this is not a replacement for doing things right.  Get in the habit of adding properly descriptive “alt” text with each image!

Still, you can put this code into your WordPress active child theme’s function.php file for a temporary fix.  This script will comb through each post’s images, find the “<img” tag and look for an “alt” attribute and put in the title of the post in the image it finds.  Not a bad fix as long as the image in the post corresponds to the title, right?!

function img_alt_tags($content){

global $post;
preg_match_all('/<img (.*?)/>/', $content, $images);
if(!is_null($images)) {foreach($images[1] as $index => $value)
{if(!preg_match('/alt=/', $value)){
$new_img = str_replace('<img', '<img alt="'.get_the_title().'"', $images[0][$index]);
$content = str_replace($images[0][$index], $new_img, $content);}}}
return $content;
}
add_filter('the_content', 'img_alt_tags', 99999);