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.
Here are a few examples of using AutoNav to display posts, as a live demo on this site.
[autonav display="posts,list,title,nothumb" count=3 postid="status:publish"]
[autonav display="posts,list,title,nothumb" orderby="title" count=3 order="ASC" postid="status:publish"]
[autonav display="posts,list,title,nothumb" orderby="rand" count=3 postid="status:publish"]
(refresh this page to see different random posts).
[autonav display="posts,list,title,nothumb" postid="category__and:autonav-plugin,plugin-compatible"]
The AutoNav plugin now supports the tag and category taxonomies that the Attachment Taxonomy Support plugin creates. Once you go thru the AutoNav settings screens. you can for example use:
[autonav display="attached" postid="tag:chocolate"]
to display a gallery of all images, attached to the current post or page, and having the tag “chocolate” … or you can even do:
[autonav display="attached" postid="-1,category:dessert"]
which will display a gallery of images in the “chocolate” attachment category, attached to any post or page.
The Grand Falls of the Little Colorado River, northern Arizona
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
Let’s explore how we can use the AutoNav plugin for WordPress to display some posts from a category.
(Note: We assume here at least version 1.4.5 of AutoNav).
This will display a list of all the posts in the dessert category, five at a time, with page navigation if there are more than 5. The count=-1 means display all the posts (without that, only the most recent 5 would be displayed)
Now let’s add a custom function which will display the post date, and the modification date if different:
Put this in your theme’s functions.php:
function autonav_list_date($html, $class, $pic, $attr) {
$postdate = substr($pic['page']->post_date,0,10);
$postmodified = substr($pic['page']->post_modified,0,10);
$html .= "<br>Posted $postdate" ;
$html .= ($postdate == $postmodified)?'':" (last modified $postmodified)";
return $html;
}
add_filter('autonav_create_list_item', 'autonav_list_date', 50, 4);
Now let’s change that so only invocations with a specific class will activate that function in AutoNav lists:
function autonav_list_date($html, $class, $pic, $attr) {
if ($attr['class'] == 'withdate') {
$postdate = substr($pic['page']->post_date,0,10);
$postmodified = substr($pic['page']->post_modified,0,10);
$html .= "<br>Posted $postdate" ;
$html .= ($postdate == $postmodified)?'':" (last modified $postmodified)";
}
return $html;
}
This now needs to be invoked with:
[autonav display="posts,list" postid="category:dessert" paged=5 count=-1 class="withdate"]
With AutoNav 1.4.5 and above: Replace the “Missing Image” text (when a page or post does not have any attached or featured image) with the title of the target page/post:
function my_missing_image($html, $pic) {
return $pic['title'];
}
add_filter('autonav_missing_image', 'my_missing_image', 10, 2);
Now in the works is an update to AutoNav — 1.4.5 is our current internal version. This update will feature:
If you are interested in beta-testing, please download here and email Bill with your comments or issues.