Hack More to Earn More
Posted by Ken Cheung on Thursday, September 7, 2006 in How-to, WordPress : : 9 commentsOn 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.
If you found this page interesting, bookmark and share it on:
Here's another tip related to the more link that allows you to add an SEO bonus of including the title of the target page in the link anchor text.
In the theme template index.php replace the template tag:
with:
Now your more links will include have the link text be the title of the page and then " Page". Works like a charm!
The "secret' is setting the $echo variable to false, otherwise the_title() function automatically echos and the title text is displayed at the beginning of the post instead as part of the more link anchor text.
Enjoy!
Mark
Here's another tip related to the more link that allows you to add an SEO bonus of including the title of the target page in the link anchor text.
In the theme template index.php replace the template tag:
" "
with:
""
(remove spaces between when pasting code)
Now your more links will include have the link text be the title of the page and then " Page". Works like a charm!
The "secret' is setting the $echo variable to false, otherwise the_title() function automatically echos and the title text is displayed at the beginning of the post instead as part of the more link anchor text.
Enjoy!
Mark
Here's another tip related to the more link that allows you to add an SEO bonus of including the title of the target page in the link anchor text.
In the theme template index.php replace the template tag:
with:
Now your more links will include have the link text be the title of the page and then " Page". Works like a charm!
The "secret' is setting the $echo variable to false, otherwise the_title() function automatically echos and the title text is displayed at the beginning of the post instead as part of the more link anchor text.
Enjoy!
Mark
PS Sorry about the multipost, my code was not being displayed. If this doesn't work, I'll just email it to you.
[...] Priemro que todo explicare que es anchor text : Anchor text es el texto que se incluye en un enlace, lo que escribas aqui es el anchor text. lo que escribas ahi, o consigas que otros escriban, es un punto muy importatnte, para los buscadores con lo cual determinan la polpularidad de una web y dar un ranking en la busqueda. Lo que escibas ahi deberas enfocarlo a las palabras claves por las cuales quieres que tu sitio o pagina aparezca con mayor relevancia en los buscadores. Una vez explicado que es el anchor text, paso a describir un tip para mejorar el anchor text en wordpress, la idea es que en los post largos utilices la etiqueta pero no como viene por defecto en el wordpress, sino haciendo una pequeñas alteraciones, lo que tratamos de conseguir es que al utilzar esta etiqueta podamos cortar en post para no presentarlo tan largo en el index o en las paginas de archivos y solo mostrar todo su contenido en la pagina individual de post en si… (a la vez evitaremos que a los buscadores les parezca contenido duplicado.), pero la idea en si es que no aparezcan las palabras: continuar leyendo.., más, o more, si no algo mas util como el titulo el post que asi , se convertira en enlace que te llevara a la pagina individual del post, la verdad es que utizar, simplemente continuar leyendo o más como anchor text no tiene sentido, que vamos a posicionar en el buscador?, con esas palabras nada que sirva. Ahora al grano: Que debes hacer: y siguiendo la recomendacion de un comentario de este post: Hack More to Earn More A. Modificar el index de tu theme buscas el código php the_content(__('Read the rest of this entry »')); y lo reemplazas por php the_content(the_title($before = ", $after = ' Page', $echo = false).' '); Dode dice Page, lo puede simplemente retirar y dejar las comillas o poner el termino mas o leer mas o continuar, lo que desees, es echo es que haciendo este pequeño cambio, ya habras logrado que el titulo de tu post aparezca como texto del enlace al utilizar more. B. La segunda modificación es opcional, pero por estetica recomendable, se trata de modificar el archivo: template-functions-post.php que esta dentro de la carpeta wp-includes; busca alli el siguiente código: $output .= ' $more_link_text"; Borrar #more-$id de la linea. La nueva linea mostrara un enlace que llevara a la dirección exacta de tu post y no a: la-direccion-de-tupots.html#more … pensandolo bien que el enlace aparezca asi en wordpress por defecto, no es muy limpio y estetico por 2 razones: no es el enlace real del post, y al visitar el post nos muestra de la parte del more hacia abajo, con lo cual el lector queda como a media pagina. El código retirandole el #more-$id queda asi: $output .= ' $more_link_text"; Recuerda antes de hacer las modificaciones hacer copias de seguridad de las paginas afectadas, no se que te equivoques y luego se te estropee algo. Además cuando cambies de theme o actualices la versión de wordpress, recuerda hacer las mismas modificaciones. Con todo lo anterior logramos varias cosas: - Cortar un post largo y evitar que los buscadores crean que duplicamos contenido dentro de nuestro sitio. - Cortar de una manera mas diciente, estetica y además útil de cara al posicionamiento en los buscadores. « Freelotto a la caza de jugadores extranjeros o que vivan fuera de USA? [...]
[...] change to template-functions-post.php in the old version of WordPress to alter the behavior of the more tag, so I had to make the change in the new version. In WP 2.1, I had to make the change in a new file [...]
I cannot find this file - "template-functions-post.php" - i know i may be being a bit dumb! - but where should it be???
In WordPress 2.1+, you will need to modify line #102 in a file called post-template.php in the wp-includes sub direcotry
Les agradesco atodos mis amigos del mundo les saludo de guatemala
bueno esas cantidades de dinero se miran bonitas pero porque piden numero de tarjeta estos mentirosos creen que uno es bruto ellos los quieren robar el pisto porque esa empresa se esta derumbando de jaranas asi que amigos no cean nada de esto los quiero gracias
Here's another tip related to the more link that allows you to add an SEO bonus of including the title of the target page in the link anchor text.