[wp-hackers] is it possible to change the_title halfway into the processing of a page/post?

Jeremy Clarke jer at simianuprising.com
Tue Feb 21 23:01:46 UTC 2012


On Mon, Feb 13, 2012 at 4:22 PM, Haluk Karamete <halukkaramete at gmail.com>wrote:

> you may find it weird, actually very weird, but is the following possible>
>
>
This is indeed a very strange request.

What you would want to do is use a _GET value in the url in the post
(href="#?alter_title_for_some_reason=alternate+title"), and check for it
elsewhere in the code, probably in a callback attached to init like:

add_action('init', 'x_detect_strange_title_altering_link');

In that function you would add a filter to the_title to use the alternate
text.

Trying to insert the logic to detect the link click inside the post is
insane. If you are trying to do that you should completely re-assess your
goals and find a whole new path to achieve them. Ultimately I don't think
there's a good reason for what you're doing anyway, there should only be
one TITLE for any given piece of content. Trying to fool Google with
something like this is more likely to get your pagerank punished than
rewarded.

-- 
Jeremy Clarke • jeremyclarke.org
Code and Design • globalvoicesonline.org


More information about the wp-hackers mailing list