Is a Custom field the optimal solution for this?

Hi,

Looking for some feedback on a simple idea.

Got a client who runs a number training courses regularly i.e. they have a ‘set’ menu of courses (they add some new ones from time to time though) which they promote and run a couple of times a year.

the url for a course could look something like this:

mysite.com/training/presentation-skills

now, they obviously want to promote the date in the Post title but, for SEO purposes (backlinking etc) and to avoid them having to change post titles continually, it may be better for me to tell them to leave the date out of the post … and use a Custom field (called Prefix or something) to hold the date for the current course they are promoting.

So when a course isn’t actively being promoted, the Custom field would be blank … when the course is being promoted they enter the date in the custom field …

I’d need to build in some code to check for the existence of the Custom field and display it if present, but that’s not difficult.

I think that idea may be the cleanest way to do things but, question is, is there a better way?

Cheers

I haven’t used custom fields much, so I don’t know how they act in the database. If they are strings you could use PHP: strtotime - Manual to convert it to time then to a date, then show it:


if(date_diff($cutsomField,date())>0){
//show featured
}

Thanks for replying.
I’m pretty comfortable with using custom fields and they work just fine for me.

My question was more about:

is it better to get the client to use a custom field

OR

let the client change the Post Title every time they want to promote/de-promote a course.

So, really, what are the potential issues around either approach?

Well, how would you get the post promoted if the title changed? “The Loop” pulls via the published date. Adjusting the title did not change the publish information on my copy of WP. I just tried this on an old post.

The down side of a custom field is ensuring that the date format the client enters stays the same.

Well, how would you get the post promoted if the title changed? “The Loop” pulls via the published date. Adjusting the title did not change the publish information on my copy of WP. I just tried this on an old post.

The down side of a custom field is ensuring that the date format the client enters stays the same.

By ‘promote’ I meant in the marketing sense e.g. when clients came to the site they could see the date of the next course.

I can set up a custom loop to pull the necessary posts but I was just wondering if there were any considerations around changing post titles that I wasn’t aware of.

For something like this, you may want to take it a step further and add a custom meta box, which they can enter the date in (you could even do a date widget). Then you can easily hook up validation, etc., ensuring things are properly formatted.

For something like this, you may want to take it a step further and add a custom meta box, which they can enter the date in (you could even do a date widget). Then you can easily hook up validation, etc., ensuring things are properly formatted.

After thinking about it, maybe I’ll use your idea and set up a simple meta box … easier for the client than digging around for custom fields …

Thanks.

No problem. I’ve been implementing various things where I work in our Wordpress-based sites, and I’ve found custom meta boxes aren’t substantial more difficult to implement, but are substantially easier for the end-user to make use of.