Quantcast
Channel: iZachy » How-to
Viewing all articles
Browse latest Browse all 13

Hack More to Earn More

$
0
0

On one of my sites, I use the <!–more–> quicktag to designate the "cut-off" point for my posts. I could use the_excerpt tag, but I don't like how the excerpts look. Unless you explicitly define the excerpt for each post, the_excerpt tag will just show the first 120 words of the post and the HTML tags are stripped from the excerpt. As a result, the excerpt can be confusing and look like crap. That's why I prefer to use the <!–more–> quicktag.

However, when readers click on the more link, they are shown the post starting from the cut-off point on down. That means they don't see the top part of the post unless they scroll up. It makes sense from a reader's point of view. Why see something you already read? However, from my point of view, it would be better to show the reader the page starting from the top. Keep in mind that I normally set the cut-off between the first and second paragraph. So I'm not forcing readers to re-read half the post. Just the first paragraph.

So what do I gain from all of this? Well, potentially more money. By showing the page from the top, readers can see my top Adsense ad. My top ads pay better than my bottom ads. When WordPress shows the post from the cut-off point down, readers don't see the top ad unless they scroll back up.

Now the tricky part, how do we get WordPress to display the page from the top on down? I looked around the WordPress Codex, but I could not find any parameters for the <!–more–> or the_content tags that would do the trick. So I had to hack one of the WordPress function (it's a simple hack). Follow the steps below if you want to change the behavior of WordPress.

Locate the file "template-functions-post.php" and make a back-up copy of the file. It's located in the "wp-includes" sub-folder where your WordPress files are installed.

Locate this line (it should be line 92 – the line wrap below is not intentional):

$output .= ' <a href="'. get_permalink() . "#more-$id\">$more_link_text</a>";

[Note: In WordPress 2.1, you will need to modify line #102 in a file called post-template.php]

$output .= ' <a href="'. get_permalink() . "\">$more_link_text</a>";

That's it. WordPress will now show the page starting with the top.

Free Magazines : : Find a Job : : iZachy : : Daddy Forever : : Embedded Star : : EDA Geek : : EDA Blog : : FPGA Blog
© 2006 Online Destiny Ltd : : iZachy is a trademark of Online Destiny Ltd


Viewing all articles
Browse latest Browse all 13

Trending Articles