Articles
It has become mandatory to use Facebook and Twitter as part of your website marketing strategy. The development environment for both Facebook and Twitter is finally getting to a point to allow good integration among the various platforms.
This can be a formidable task for the developer/consultant as well as the client to understand how the platforms all tie into a marketing strategy.
Except for large project, we develop exclusively on WordPress for websites, and fortunately there are some great plugins to easily (almost) set up a way to PUSH or PULL content between your website and FaceBook Page and Twitter account. The client may want to post their content on all platforms separately, but this is burdensome for most. It is more likely they will want to post on one platform primarily and have it disseminate to the others automatically.
The first question is to ask where the client feels most comfortable publishing content. If the spend their day on Facebook, then the solution is better to pull content from Facebook to the website. A good plugin for this is Facebook Like Box. This will add a like button, photo gallery and the posts as a widget.
To pull tweets I depend on Genesis – Latest Tweets. We develop all our sites on the Genesis Framework and this is one of many great plugins included.
If the client wants to publish on their website, they will want to PUSH their data to both FB and Twitter. I recommend WP-To-Twitter and Facebook-page-publish for these tasks (also Wordbooker). To accomplish both of these tasks, you will need to establish an application.

Experts Exchange is a great service where you can post your programming issue and you will more likely get a quick and professional response. You can either earn points by answering other questions or you can pay a monthly fee.
This is the best service I’ve seen by far and I have been using it for years. It has paid for itself many times over by saving me time when I’ve been stumped.
They also have a new look and feel. Check it out by clicking on the pic at the top.
If images are float left on a listing/blog page and the next item doesn’t break below the image but continues to wrap around it, you need to add a float:left and clear: both to a class in the style.css.
See below
#featured-bottom .featuredpost .post, #featured-bottom .featuredpage .page {
margin: 0 0 10px 0;
padding: 10px 0 15px 0;
border-bottom: 1px solid #333333;
float: left;
clear: both;
}
Gravity forms is a plugin for WordPress to build forms for surveys and mailings. It isn’t free, but well worth the price as a very well designed product. If you are in the business of building websites, you inevitably will be needing to have at least a contact form on each of your sites, and having a consistent plugin on all your sites is invaluable.
Gravity will create a couple tables and allows you to easily view all form submissions and export to Excel. You can very quickly build forms with pull down menus, radio buttons, CAPTCHA, auto responders and many other advanced features.
The developer’s version will cost you $199, which is a bit pricey, but allows you to use it on unlimited sites.
Parsing names is an age-old process of taking a full name (i.e. “Mr. John C. Smith, Jr.”) and extracting the first name, last name, middle name, etc.
The following SQL Server function handles 99% of the situations, including prefixes, suffixes and hyphenated names. It will get tripped up with two first names, but that is extremely difficult to trap for.
To call this function, use use the following syntax:
select dbo.PARSE_NAME_UDF(full_name,’F') as FirstName, dbo.PARSE_NAME_UDF(full_name,’L') as LastName from myTable
create function [dbo].[PARSE_NAME_UDF](@NameString varchar(100), @NameFormat varchar(20))
returns varchar(100) as
begin–PARSE_NAME_UDF decodes a NameString into its component parts and returns it in a requested format.
–@NameString is the raw value to be parsed.
–@NameFormat is a string that defines the output format. Each letter in the string represents
–a component of the name in the order that it is to be returned.
– [H] = Full honorific
– [h] = Abbreviated honorific
– [F] = First name
– [f] = First initial
– [M] = Middle name
– [m] = Middle initial
– [L] = Last name
– [l] = Last initial
– [S] = Full suffix
– [s] = Abbreviated suffix
– [.] = Period
– [,] = Comma
– [ ] = Space
–Test variables
– declare @NameString varchar(50)
– declare @NameFormat varchar(20)
– set @NameFormat = ‘F M L S’
– set @NameString = ‘Melvin Carter, Jr’Declare @Honorific varchar(20)
Declare @FirstName varchar(20)
Declare @MiddleName varchar(30)
Declare @LastName varchar(30)
Declare @Suffix varchar(20)
Declare @TempString varchar(100)
Declare @TempString2 varchar(100)
Declare @IgnorePeriod char(1)–Prepare the string
–Make sure each period is followed by a space character.
set @NameString = rtrim(ltrim(replace(@NameString, ‘.’, ‘. ‘)))–Remove disallowed characters
declare @PatternString varchar(50)
set @PatternString = ‘%[^a-z ,-]%’
while patindex(@PatternString, @NameString) > 0 set @NameString = stuff(@NameString, patindex(@PatternString, @NameString), 1, ‘ ‘)–Remove telephone ext
set @NameString = ltrim(rtrim(replace(‘ ‘ + @NameString + ‘ ‘, ‘ EXT ‘, ‘ ‘)))–Eliminate double-spaces.
while charindex(‘ ‘, @NameString) > 0 set @NameString = replace(@NameString, ‘ ‘, ‘ ‘)–Eliminate periods
while charindex(‘.’, @NameString) > 0 set @NameString = replace(@NameString, ‘.’, ”)–Remove spaces around hyphenated names
set @NameString = replace(replace(@NameString, ‘- ‘, ‘-’), ‘ -’, ‘-’)–Remove commas before suffixes
set @NameString = replace(@NameString, ‘, Jr’, ‘ Jr’)
set @NameString = replace(@NameString, ‘, Sr’, ‘ Sr’)
set @NameString = replace(@NameString, ‘, II’, ‘ II’)
set @NameString = replace(@NameString, ‘, III’, ‘ III’)–Temporarily join multi-word surnames
set @NameString = ltrim(replace(‘ ‘ + @NameString, ‘ Del ‘, ‘ Del~’))
set @NameString = ltrim(replace(‘ ‘ + @NameString, ‘ Van ‘, ‘ Van~’))
set @NameString = ltrim(replace(‘ ‘ + @NameString, ‘ Von ‘, ‘ Von~’))
set @NameString = ltrim(replace(‘ ‘ + @NameString, ‘ Mc ‘, ‘ Mc~’))
set @NameString = ltrim(replace(‘ ‘ + @NameString, ‘ Mac ‘, ‘ Mac~’))
set @NameString = ltrim(replace(‘ ‘ + @NameString, ‘ La ‘, ‘ La~’)) –Must be checked before “De”, to handle “De La [Surname]“s.
set @NameString = ltrim(replace(‘ ‘ + @NameString, ‘ De ‘, ‘ De~’))–If the lastname is listed first, strip it off.
set @TempString = rtrim(left(@NameString, charindex(‘ ‘, @NameString)))
–Below logic now handled by joining multi-word surnames above.
–if @TempString in (‘VAN’, ‘VON’, ‘MC’, ‘Mac’, ‘DE’) set @TempString = rtrim(left(@NameString, charindex(‘ ‘, @NameString, len(@TempString)+2)))–Search for suffixes trailing the LastName
set @TempString2 = ltrim(right(@NameString, len(@NameString) – len(@TempString)))
set @TempString2 = rtrim(left(@TempString2, charindex(‘ ‘, @TempString2)))if right(@TempString2, 1) = ‘,’
begin
set @Suffix = left(@TempString2, len(@TempString2)-1)
set @LastName = left(@TempString, len(@TempString))
end
if right(@TempString, 1) = ‘,’ set @LastName = left(@TempString, len(@TempString)-1)
if len(@LastName) > 0 set @NameString = ltrim(right(@NameString, len(@NameString) – len(@TempString)))
if len(@Suffix) > 0 set @NameString = ltrim(right(@NameString, len(@NameString) – len(@TempString2)))–Get rid of any remaining commas
while charindex(‘,’, @NameString) > 0 set @NameString = replace(@NameString, ‘,’, ”)
–Get Honorific and strip it out of the string
set @TempString = rtrim(left(@NameString, charindex(‘ ‘, @NameString + ‘ ‘)))
if @TempString in (
‘Admiral’, ‘Adm’,
‘Captain’, ‘Cpt’, ‘Capt’,
‘Commander’, ‘Cmd’,
‘Corporal’, ‘Cpl’,
‘Doctor’, ‘Dr’,
‘Father’, ‘Fr’,
‘General’, ‘Gen’,
‘Governor’, ‘Gov’,
‘Honorable’, ‘Hon’,
‘Lieutenant’, ‘Lt’,
‘Madam’, ‘Mdm’,
‘Madame’, ‘Mme’,
‘Mademoiselle’, ‘Mlle’,
‘Major’, ‘Maj’,
‘Miss’, ‘Ms’,
‘Mr’,
‘Mrs’,
‘President’, ‘Pres’,
‘Private’, ‘Pvt’,
‘Professor’, ‘Prof’,
‘Rabbi’,
‘Reverend’, ‘Rev’,
‘Senior’, ‘Sr’,
‘Seniora’, ‘Sra’,
‘Seniorita’, ‘Srta’,
‘Sergeant’, ‘Sgt’,
‘Sir’,
‘Sister’) set @Honorific = @TempString
if len(@Honorific) > 0 set @NameString = ltrim(right(@NameString, len(@NameString) – len(@TempString)))
–Get Suffix and strip it out of the string
if @Suffix is null
begin
set @TempString = ltrim(right(@NameString, charindex(‘ ‘, Reverse(@NameString) + ‘ ‘)))
if @TempString in (
‘Attorney’, ‘Att’, ‘Atty’,
‘BA’,
‘BS’,
‘CPA’,
‘DDS’,
‘DVM’,
‘Esquire’, ‘Esq’,
‘II’,
‘III’,
‘IV’,
‘Junior’, ‘Jr’,
‘MBA’,
‘MD’,
‘OD’,
‘PHD’,
‘Senior’, ‘Sr’) set @Suffix = @TempString
if len(@Suffix) > 0 set @NameString = rtrim(left(@NameString, len(@NameString) – len(@TempString)))
endif @LastName is null
begin
–Get LastName and strip it out of the string
set @LastName = ltrim(right(@NameString, charindex(‘ ‘, Reverse(@NameString) + ‘ ‘)))
set @NameString = rtrim(left(@NameString, len(@NameString) – len(@LastName)))
–Below logic now handled by joining multi-word surnames above.
/* –Check to see if the last name has two parts
set @TempString = ltrim(right(@NameString, charindex(‘ ‘, Reverse(@NameString) + ‘ ‘)))
if @TempString in (‘VAN’, ‘VON’, ‘MC’, ‘Mac’, ‘DE’)
begin
set @LastName = @TempString + ‘ ‘ + @LastName
set @NameString = rtrim(left(@NameString, len(@NameString) – len(@TempString)))
end
*/
end
–Get FirstName and strip it out of the string
set @FirstName = rtrim(left(@NameString, charindex(‘ ‘, @NameString + ‘ ‘)))
set @NameString = ltrim(right(@NameString, len(@NameString) – len(@FirstName)))
–Anything remaining is MiddleName
set @MiddleName = @NameString
–Create the output string
set @TempString = ”
while len(@NameFormat) > 0
begin
if @IgnorePeriod = ‘F’ or left(@NameFormat, 1) <> ‘.’
begin
set @IgnorePeriod = ‘F’
set @TempString = @TempString +
case ascii(left(@NameFormat, 1))
when ’32′ then case right(@TempString, 1)
when ‘ ‘ then ”
else ‘ ‘
end
when ’44′ then case right(@TempString, 1)
when ‘ ‘ then ”
else ‘,’
end
when ’46′ then case right(@TempString, 1)
when ‘ ‘ then ”
else ‘.’
end
when ’70′ then isnull(@FirstName, ”)
when ’72′ then case @Honorific
when ‘Adm’ then ‘Admiral’
when ‘Capt’ then ‘Captain’
when ‘Cmd’ then ‘Commander’
when ‘Cpl’ then ‘Corporal’
when ‘Cpt’ then ‘Captain’
when ‘Dr’ then ‘Doctor’
when ‘Fr’ then ‘Father’
when ‘Gen’ then ‘General’
when ‘Gov’ then ‘Governor’
when ‘Hon’ then ‘Honorable’
when ‘Lt’ then ‘Lieutenant’
when ‘Maj’ then ‘Major’
when ‘Mdm’ then ‘Madam’
when ‘Mlle’ then ‘Mademoiselle’
when ‘Mme’ then ‘Madame’
when ‘Ms’ then ‘Miss’
when ‘Pres’ then ‘President’
when ‘Prof’ then ‘Professor’
when ‘Pvt’ then ‘Private’
when ‘Sr’ then ‘Senior’
when ‘Sra’ then ‘Seniora’
when ‘Srta’ then ‘Seniorita’
when ‘Rev’ then ‘Reverend’
when ‘Sgt’ then ‘Sergeant’
else isnull(@Honorific, ”)
end
when ’76′ then isnull(@LastName, ”)
when ’77′ then isnull(@MiddleName, ”)
when ’83′ then case @Suffix
when ‘Att’ then ‘Attorney’
when ‘Atty’ then ‘Attorney’
when ‘Esq’ then ‘Esquire’
when ‘Jr’ then ‘Junior’
when ‘Sr’ then ‘Senior’
else isnull(@Suffix, ”)
end
when ’102′ then isnull(left(@FirstName, 1), ”)
when ’104′ then case @Honorific
when ‘Admiral’ then ‘Adm’
when ‘Captain’ then ‘Capt’
when ‘Commander’ then ‘Cmd’
when ‘Corporal’ then ‘Cpl’
when ‘Doctor’ then ‘Dr’
when ‘Father’ then ‘Fr’
when ‘General’ then ‘Gen’
when ‘Governor’ then ‘Gov’
when ‘Honorable’ then ‘Hon’
when ‘Lieutenant’ then ‘Lt’
when ‘Madam’ then ‘Mdm’
when ‘Madame’ then ‘Mme’
when ‘Mademoiselle’ then ‘Mlle’
when ‘Major’ then ‘Maj’
when ‘Miss’ then ‘Ms’
when ‘President’ then ‘Pres’
when ‘Private’ then ‘Pvt’
when ‘Professor’ then ‘Prof’
when ‘Reverend’ then ‘Rev’
when ‘Senior’ then ‘Sr’
when ‘Seniora’ then ‘Sra’
when ‘Seniorita’ then ‘Srta’
when ‘Sergeant’ then ‘Sgt’
else isnull(@Honorific, ”)
end
when ’108′ then isnull(left(@LastName, 1), ”)
when ’109′ then isnull(left(@MiddleName, 1), ”)
when ’115′ then case @Suffix
when ‘Attorney’ then ‘Atty’
when ‘Esquire’ then ‘Esq’
when ‘Junior’ then ‘Jr’
when ‘Senior’ then ‘Sr’
else isnull(@Suffix, ”)
end
else ”
end
–The following honorifics and suffixes have no further abbreviations, and so should not be followed by a period:
if ((ascii(left(@NameFormat, 1)) = 72 and @Honorific in (‘Rabbi’, ‘Sister’))
or (ascii(left(@NameFormat, 1)) = 115 and @Suffix in (‘BA’, ‘BS’, ‘DDS’, ‘DVM’, ‘II’, ‘III’, ‘IV’, ‘V’, ‘MBA’, ‘MD’, ‘PHD’)))
set @IgnorePeriod = ‘T’
end
set @NameFormat = right(@NameFormat, len(@NameFormat) – 1)
end
–select replace(@TempString, ‘~’, ‘ ‘)
Return replace(@TempString, ‘~’, ‘ ‘)
end
Although WordPress is the undisputed leader as a website CMS (yes, it is a CMS), “real” developers snub their noses at WordPress because it is just a “blog” and doesn’t have all the power of Drupal or Joomla.
Enter the Genesis Framework and the StudioPress suite of child themes. I have built dozens of sites with StudioPress, and am incredibly impressed. It is JUST what I needed to add power and consistency to my sites.
By using Genesis/StudioPress for WordPress, I get the best of both worlds, the ease of use of the most popular platform (and there is a good reason it is), and the power and scalability of more “advanced” CMS platforms.
It isn’t free, but if you are in the business of building websites, then the nominal life-time fee for support from solid programmers, dozens of super high quality child themes, and the powerful framework and suite of plugins is well worth the price.
There are other frameworks, but Genesis has the advantage of being late in the game and building from the ground up a extremely powerful set of hooks and functions that is tightly integrated in the WordPress 3.0+ way of doing things. The fact that it uses child themes in itself makes it far superior to frameworks such as Thesis.
Non-programmers will find the modularized structure hard to understand, but if you get over the learning curve, you’ll see the incredible power it provides. I now build ALL my websites in Genesis, even custom sites, and am even converting my old projects to the framework so all my sites have a consistent grounding.
WordPress seems limited with the way it handles images (media). I don’t see why it can’t be part of the taxonomy like posts and pages since it is stored in the wp_posts table.
A media item is “attached” to a post if it has a value in the post_parent field. It can only be attached to one post.
If you have a gallery in a post and need to move them the only way to do it is via sql in the MySQL db.
Here is the sql to update in bulk media records to a new “parent.” You need the post ID for both the post you are moving from to the one you are moving to….
update wp_posts t1 set t1.post_parent = 713 where post_parent = 444 and post_type = ‘attachment’
This was an email posted in the wwwac.org listserv. It’s a nice overview of the pros and cons of the “big three” open source CMSs.
WordPress is wonderful for a basic content site, especially for blogs and personal stuff. Lots of plugins to add functionality, fairly easy to use right out of the box for a person with minor technical skills. With a bit of study, one can learn how to customize it and personalize it.
I used to use Joomla, and its predecessor Mambo, after years of building custom PHP-based CMS sites.
If you need to migrate WordPress to another server, sometimes it will have a different URL. That will break all the image links in the content of the pages.
The best thing to do is do a bulk replace in MySQL. The command is as follows
update wp_posts set post_content = replace(post_content, ‘searchURL’, ‘replaceURL’);
Sometimes you want to show future posts, likely when you have posts that are events.
<?php
// ———— added for events to show future
if(is_category(‘events’))
query_posts($query_string . ‘&order=ASC&post_status=future’);while (have_posts()) : the_post();
if(is_category(‘events’)) {
if(strtotime($post->post_date) < time())
continue;
}
?>



