Adsense Ad at the More Tag Position

Surprise your readers with a google ad after clicking the ‘read more’ link – a strategic position to catch the attention of the viewer and increase your revenue.

Advertising does not get the same attention all over your page, as this report shows, some areas are ‘hotter’ than others, and the top of your content is one of the ‘hottest’.

Many of you insert the ‘more-tag’ after a short introductionary part of your content when writing your articles – usually to keep the design of the home page clean and easy to navigate.

When  the reader clicks on the ‘continue reading’ button, this already proves that the article has so far captured his attention – and the reader is more likely to follow any targeted advertising links, particular if these are seamlessly integrated into the main post content.

Continue reading “Adsense Ad at the More Tag Position”

Custom ‘Read More’ text per Post for Twenty Ten

A sophisticated way to get a custom written ‘read more’ text added to your posts in the theme Twenty Ten (or its child themes).

The code builds on this article I posted earlier.

It uses the custom field with the key ‘cont_read’ to hold the custom text.

Add this code to functions.php of the theme:

/* Twenty Ten custom 'continue reading'
/
/ custom field ($key = 'cont_read' ) dependant 'continue reading' text
/ alchymyth 2010
*/
class Transformation_Text_Wrangler {
function reading_more($translation, $text, $domain) {

global $post;
 $cont_read = get_post_meta( $post->ID, 'cont_read', true );
 if( $cont_read ) :
 $cont_read = htmlentities($cont_read, ENT_QUOTES);
 $translations = &get_translations_for_domain( $domain );
 if ( $text == 'Continue reading <span>&rarr;</span>' ) {
 return $translations->translate( $cont_read . ' <span>&raquo;</span>' );
 }
 return $translation; // custom field value
 else :
 return $translation; // standard text
 endif;
 }
}
add_filter('gettext', array('Transformation_Text_Wrangler', 'reading_more'), 10, 4);

‘Read-more’ on all Excerpts in WordPress

Occasionally, the excerpt does not show a read-more at the end of the text. This is obviously the case, if the text content of the post is shorter than the set excerpt length.

Normally this is no problem – however, if your post contains images and/or important formatting, you would like to point the reader to the full post.

The above also assumes that you have customized your theme, to show a link to the post at the end of the excerpt – refer to the Codex chapter ‘Make the read-more link to the post‘.

A way to remedy the situation, is to edit functions.php of the theme, and to find the related code, such as:

function new_excerpt_more($more) {        global $post; 	return '<a href="'. get_permalink($post->ID) . '">' . 'Read the Rest...' . '</a>'; } add_filter('excerpt_more', 'new_excerpt_more');

Remove that, and add a new filter function in its place; something like:

function excerpt_read_more_link($output) {
 global $post;
 return $output . '<a href="'. get_permalink($post->ID) . '">Read All ...</a>';
}
add_filter('the_excerpt', 'excerpt_read_more_link');

And now you have a ‘read-more’ link at the end of each excerpt, linked to the full post.

Finding Exact Information on WordPress Functions

According to my motto:

‘Knowledge is Knowing where it is Written’
by Albert Einstein

– I like to look up the core files of WordPress where the functions are defined.

What I quite often do when I come across something new or not fully understood – a function, or template tag, or whatever wordpress related:

I search the web for it; not just with any keywords, but quite focussed.

Lets take the example of one of my earlier posts (Front Page Comments on your WordPress Blog) where I was investigating why comments don’t easily show on the front page or on archive pages of a blog:

The function in the template files that would show comments and the comment form, is ‘comments_template()’ – I therefore search for:

‘function comments_template()’

the search engine of my choice returns (apart from many other links) first of all the link to the documentation in the codex; and a link to the core file (and the exact line):

Obviously, my search engine knows me, so the relevant results show quite at the top of all possible search results; you may need to scroll down a few pages to find the important link: the one beginning with ‘PHPXRef’.

the link to follow is:
http://phpxref.ftwr.co.uk/wordpress/_functions/comments_template.html

in the page that opens, you’ll get the line:
defined at: followed by a link.

click on that link;

http://phpxref.ftwr.co.uk/wordpress/wp-includes/comment-template.php.html#comments_template

that leads you to:

with a list of some functions; click on the title of the one you are looking up.

http://phpxref.ftwr.co.uk/wordpress/wp-includes/comment-template.php.source.html#l822

in there in line 851, you have it (the code that explains why comments do not automatically show on the front page; and what you can do to make them show):

851      if ( !(is_single() || is_page() || $withcomments) || empty($post) )

btw:
This search method is also great for finding related functions, global wordpress variables, and expanding your vocabulary and understanding of wordpress terms…