WordPress: Custom “more…” text
Filed in: WordPress — September 16th, 2004In WordPress, you type <!--more--> in content to separate content to another page. It will display a link with “(more…)” which bring you to follow part of content.
Not all people happy with the dull “more…” text. Thanks to ringmaster. He/She posted a simple trick for Per-post custom “(more…)”.
- In WordPress “index.php”, find:
<?php the_content(); ?>Replace the line with:
<?php
$somemore = ‘(more…)’;
$maybemore = get_post_custom_values(‘more’);
if(count($maybemore) > 0) $somemore = $maybemore[0];
the_content(‘‘.$somemore.’‘);
?> - At the post you want(in Advanced Editing mode) to have custom “more…” text, add a new Custom Field key called “more” and type in the value you want. It will replace “(more…)” with the value you entered.
Like this post? Please share:
Follow me on Twitter and Facebook. Subscribe to free newsletter for updates like this article..



