Here is an example AutoNav filter that will display a “Read More” link, for posts in a list.
We invoke this as follows:
[autonav display="posts,list,title,nothumb,excerpt" count=5 postid="category:autonav-plugin" class="readmore"]
Live demo form the posts on this site:
Let's explore how we can use the AutoNav plugin for WordPress to display some posts from a category.
Put this code in your theme’s functions.php:
function autonav_excerpt_readmore($html, $class, $pic, $attr) {
if ($attr['display'] == 'posts' && $attr['class'] == 'readmore') {
if (strlen($pic['excerpt'])) {
$html .= '<a href="' . $pic['permalink'] . '">' . __('Read more') . '...</a>';
}
}
return $html;
}
add_filter('autonav_create_list_item', 'autonav_excerpt_readmore',
50, 4);
The filter is added with priority 50, so it will be inserted after the excerpt. The function only inserts the “Read More” link if the class="readmore" parameter is used in the AutoNav invocation, and only if posts are listed, and only if the post actually had an excerpt.
NOTE: The above was originally asked here.
The Grand Falls of the Little Colorado River, northern Arizona
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |