How can I dynamically generate page title & desc with PHP variables? Configuring All in One SEO Pack Forum

The support forums have a new home! Please visit All in One SEO Pack's new residence at Semper Plugins to purchase a support plan.

Please consider registering
guest

Log In

Lost password?
Advanced Search

— Forum Scope —

  

— Match —

   

— Forum Options —

   

Minimum search word length is 4 characters - maximum search word length is 84 characters

Topic RSS
How can I dynamically generate page title & desc with PHP variables?
December 30, 2009
8:41 am
baquila
Guest

I'm listing jobs from a database based on the user's form input of either city & state or zip. What I would like to do is dynamically generate the page title and description using PHP variables based on the user's input. The form will be submitted through a a get statement ( for instance: $_GET['city'] ) and I'd like to insert whatever variables they enter into the title and description. I am only doing this for one page on my site. 

For instance, if they are searching for jobs in Memphis, TN I would like the page title to be:

"Jobs Memphis, TN | Memphis, TN Job Search "

....and description to be:

"Search our Jobs database for jobs in Memphis, TN and areas within 50 miles of Memphis, TN"

This is simple outside of Wordpress - just put <? echo "<title>Jobs " . $city . "," . $state . "</title>";   // something to that effect - in the head after receiving the $_GET variables.

What would be the best way to accomplish this on one single Wordpress page using All In One SEO?

The url is http://www.bigrigdriving.com/truck-driving-jobs   but the form isn't setup yet and I don't think visiting the site will help with figuring this out anyhow :-)

Thanks so much in advance!

December 30, 2009
9:08 am
Cary, NC
Admin
Forum Posts: 202
Member Since:
June 8, 2009
Offline

Hi baquila,

You should be able to use the All in One SEO Pack API hooks aioseop_description and aioseop_title_single or aioseop_title_page.

For what shall it profit a man, if he shall gain the whole world, and lose his own soul?
December 31, 2009
1:51 pm
baquila
Guest

Ok, I give up. After a couple of hours of searching the plugin page, the download directory, the readme, the forums, and everyplace else on Earth I can think of, I can't find any documentation on these filter hooks. Is there any documentation on them?

December 31, 2009
3:31 pm
Cary, NC
Admin
Forum Posts: 202
Member Since:
June 8, 2009
Offline

http://codex.wordpress.org/Plugin_API explains how to use hooks in WordPress.

For what shall it profit a man, if he shall gain the whole world, and lose his own soul?
January 1, 2010
9:40 am
baquila
Guest

Ok, well I can see that apparently you're not about to really help anyone out  unless they're paying you - even for 5 minutes - so for those who are interested I solved the problem by disabling the AIOSEO plugin for that particular page and used a custom header file to collect the variables and echo out the title and description. Problem solved.  

January 1, 2010
7:16 pm
Cary, NC
Admin
Forum Posts: 202
Member Since:
June 8, 2009
Offline

Ok, well I can see that apparently you're not about to really help anyone out  unless they're paying you

The hundreds of people I've helped (for free) will disagree with you.  I showed you the hooks needed, then as requested, showed you the documentation on how to use them (all for free, without asking for payment).  I'm not sure what else you're wanting, short of me writing your code for you.

For what shall it profit a man, if he shall gain the whole world, and lose his own soul?
Forum Timezone: America/New_York

Most Users Ever Online: 259

Currently Online:
24 Guest(s)

Currently Browsing this Page:
1 Guest(s)

Top Posters:

Michael Torbert: 2

Member Stats:

Guest Posters: 1561

Members: 6

Moderators: 0

Admins: 4

Forum Stats:

Groups: 5

Forums: 23

Topics: 1302

Posts: 3192

Newest Members: Nina Gerrero, Dawa

Administrators: WordPress Professional: 478, hallsofmontezuma: 202, onefinejay: 10, stevemortiboy: 4