Plugin Directory

Test out the new Plugin Directory and let us know what you think.

AutoNav Graphical Navigation and Gallery Plugin

Creates lists/tables of text/thumbnails/links to posts, pages, taxonomies, attachments, custom post types, image directories.

How is a Child Page's "Associated Image" determined?

AutoNav uses the first of these that exist, as the associated picture for a child page:

  • The value of the custom field, subpage_thumb. The value can be either a URL (http://......) or a path relative to the wp-content/uploads directory (2011/07/image.jpg).

  • The post/page Thumbnail ("Featured Image") as set in WordPress (assuming your theme supports them -- see next question on how to enable theme support).

  • The attached image with the lowest Order as chosen in the Gallery tab of the attachment dialog.

NOTE: If a URL is given in subpage_thumb, that image will be used directly; AutoNav cannot resize it. In all other cases, AutoNav will create the needed thumbnail images automatically.

How do I enable post thumbnails in WordPress?

If you don't see the Post Thumbnail (or Featured Image) section in your administration screens, add this to your theme's functions.php --

How do I override the title for a child page?

Create a Custom Field called subpage_title for the page. Set it to what you would like displayed in the table or list of child pages.

How do I use AutoNav on my "home" page, to show all my sub-pages?

When invoked on the page set as the Static Home Page, if that page has no children, then the other pages at top level (those with no parent) are considered as children of the home page. In all other cases, if you wish to display pages at the same level as the current page (i.e., the other children of the parent of the current page), you can use the 'siblings' parameter.

How can I display posts in a list?

The following will display posts in the 'desserts' category, in a bulleted list, with the title as a link to the page:

[autonav display="posts,list,title,nothumb" postid="category:desserts"]

The "nothumb" parameter suppresses the "missing image" error message for posts that do not have thumbnails.

To display posts not in a certain category, use the category's slug as follows:

[autonav display="posts,list,title,nothumb" 

You can use multiple category IDs or slugs with the three modifiers category__in (posts in any of the categories), category__and (only posts which must be in all the categories listed), or category__not_in (posts which must not be in any of the categories listed). This lists posts that are in either the 'desserts' or the 'sweets' categories:

[autonav display="posts,list,title,nothumb" 

Only the first five posts get displayed.

By default, WordPress's built-in function get_posts(), which is what AutoNav uses to find posts and attachments, only returns the first five results. You can choose how many you wish displayed with something like this:

[autonav display="posts,list,title,nothumb" postid="category:desserts"

If you would like the viewer to be able to access more than the first ten posts, you can use the paged parameter:

[autonav display="posts,list,title,nothumb" postid="category:desserts"
count=10 paged=10]

which will display 10 posts, and include "next/previous" links to navigate through any additional ones. (Example courtesy spartaneye)

Can I display a random gallery?

Try this:

[autonav display="attached" postid="-1" orderby="rand" count=10]

which will display ten of your attachments at random, regardless of the post or page to which they are attached. The special case of -1 for postid means "any post or page."

What CSS classes does this plugin create?

In navigation mode, when a list is selected:

  • ul elements have class: subpages-list
  • li elements have class: subpages-item
  • Excerpt text: subpages-excerpt
  • Thumbnail images: subpages-list-image

In table modes:

  • table elements: subpages-table
  • tr elements: subpages-row
  • td elements: subpages-cell
  • p elements inside each td: subpages-text
  • Thumbnail images: subpages-image
  • Excerpt text: subpages-excerpt

Next/Previous page links (with 'paged' parameter):

  • p elements: subpages-pages

The 'subpages' prefix may be overridden by the 'class' parameter or on the administration screen.

What custom fields will AutoNav use?

These are described in detail in other FAQ entries:

  • subpage_thumb: Set to a URL (http://example.com/image.jpg or https://...) or to a path relative to your uploads directory
  • subpage_title: Overrides the title of a page or post
  • subpage_excerpt: Overrides the excerpt of a page or post

I updated the plugin, but the new parameters are not recognized.

Go through the Autonav Options on the WordPress administration screen once, and save the options. That will add the new parameter names to the list of recognized ones.

Can I re-attach an attachment to another page?

Thru the Change Attachment Parent plugin, which is an easy way to reset the parent page or post for any attachment, right on the attachment's Edit screen in the Media Library. You do need to know the new parent's ID, though.


Another plugin adds the same feature to the Bulk Actions admin dropdown:


How can I rearrange my posts and pages?

Try the Pagemash plugin which lets you move pages up, down, in, out, and around your hierarchy with the mouse. It automatically changes the pages' parents and menu order.


If it's posts you wish to rearrange, try this:


and use [autonav display="posts" orderby="postmash"]

Can I disable certain attached images?

Yes, using the Media Library in the admin screens, set an image's Order to -101 or less, and it will not be shown with [autonav display=attached] NOTE: rearranging attachments in WordPress's dialogs will reset all those attachments' order to a positive number.

You can also set the post_status of an attachment to 'private' or 'draft' although WordPress gives you no built-in menus to do this.

The Semi-Private Attachments plugin lets you mark an attachment as private. AutoNav respects this (as does the built-in gallery shortcode) and will not display it. The plugin also lets you disable comments and pings for an attachment.


Some of my images do not appear.

If you upload a picture with a filename that resembles WordPress' resized image names, the Autonav plugin may not be able to find it. For example, if you upload a picture called mybike-640x528.jpg, WordPress will create thumbnails and there will be three files in the uploads directory:


Autonav will not find your "full size" picture, the 640x528 one, because it ends in a dash followed by two numbers with an 'x' inbetween. You will have to rename your original picture before uploading it into WordPress.

AutoNav does not detect a child page's, or a post's, thumbnail.

Double-check that you have explicitly set a Featured Image for the post or page. Merely invoking [autonav] in a post or page, although that can cause a gallery to be displayed, does not set a featured image.

How do I use excerpts with pages and posts?

Examples of displaying excerpts:

[autonav display="list,excerpt"]
[autonav display="posts,list,excerpt" postid="category:news" pics_only=0]

For any post or page, you can always use the custom field 'subpage_excerpt' which will override any WordPress excerpt.

NOTE: By default, WordPress includes the ability to edit manual excerpts only for Posts, not Pages. You can add a single line of code to your theme's functions.php to enable excerpts for Pages:

add_post_type_support( 'page', 'excerpt' );

Can I call the plugin from a template?

Yes, you may use this code in your template, for example, where you wish a table of child pages' thumbnails:

<?php print autonav_wl_shortcode(array('display'=>'images')); ?>

or where you would like a table of all attached images:

<?php print autonav_wl_shortcode(array('display'=>'attached')); ?>

Can I show all attachments, but highlight the first couple?

Yes; try these three lines:

[autonav display=attached columns=1 count=1 size=500x500]
[autonav display=attached columns=1 start=1 count=1 size=300x300]
[autonav display=attached columns=4 start=2]

You could even include similar calls in a template (see above), showing the first attachment in the large size in one place, the second attachment in medium size elsewhere, and all remaining attachments at perhaps the bottom.

Can I display tooltips?

Yes, when displaying attached images, the image's Title as set through the Wordpress admin screen is put into the 'a' tag's title attribute. On modern browsers this becomes a tooltip when hovering over the image inside the anchor.

How do I use AutoNav's filters?

AutoNav provides filters which you can hook. They are internally called as follows. Note that $class is the effective CSS class for the item in question; $attr is the set of attributes for all pictures, as passed in the [autonav] shortcode and taken from the default values set in the administration screen; $pic is an array created for each page, post, or the like.

  • $pic_info = apply_filters('autonav_select', $pic_info, $attr); -- Is called whenever display= has a value which is not handled by any of the built-ins, so you can add your own display= values. Return value should be an array in the style of pic_info (see source code). This filter is responsible for creating or finding all thumbnails and setting all links in the pic_info array. If your filter does nothing, you should return $pic_info to permit chaining multiple filters.

  • $pic_info = apply_filters('autonav_thumb', $pic_info, $attr, $post ) This filter is used to locate the featured thumbnail for a post or page. If $pic_info is not empty, successive filters assume that the thumbnail has been located, and return $pic_info unmodified. The default behaviour is as follows:

    add_filter('autonav_thumb', 'autonav_thumb_featured', 10, 4); add_filter('autonav_thumb', 'autonav_thumb_specified', 20, 4); add_filter('autonav_thumb', 'autonav_thumb_attached', 30, 4);

  • $attr = apply_filters('autonav_pre_select', $attr, $display_options); -- This permits you to modify the array which AutoNav uses to determine which pages or posts to display. Elements here are nearly same as values in the Options screen.

  • $picked_files = apply_filters('autonav_pick_files', $picked_files, $attr, $pic_size_info); Given the calling arguments ($attr) and an array of image files found for the specified posts, pages, or directories. The latter array also includes information for each of the thumbnail sizes found for each of the full-size images. The filter then picks which images are candidates to include, before the autonav_get_thumbnails filter.

  • $pics_info = apply_filters('autonav_get_thumbnails', $pics_info, $attr, $pic_size_info); The filter chooses from available sizes in $pic_size_info, or creates resized images.

  • $pic_info = apply_filters('autonav_post_select, $pic_info, $attr); This filter runs after AutoNav's internal page/post selection process, or after your custom display= selection filter (see above). At this point, AutoNav assumes that all links are set and any thumbnail images have been created. With this filter, you can delete pages from the ready-to-format pic_info array of pages/posts to be displayed, or change values in the array, before the formatting code splits it into tables, or multiple pages (see WP: paginate_links).

  • $html = apply_filters('autonav_create_list_item', $html, $class, $pic, $attr); $html = apply_filters('autonav_create_table_item', $html, $class, $pic, $attr);

    These create the individual list or table entries, and are called once for each post or page which exists in the 'selected' array as passed through the autonav_post_select filter. The input $html is all the HTML output created so far; generally you will append to this and return the extended text. You may add additional filters here to be called in priority order along with the built-in methods; or you may remove the built-in filter and replace with your own. Note the following default priorities: Tables: 10 for Image and main content; 15, Title text; 20, Excerpt. Lists: 10 for Title text; 15, Image and main content; 20, Excerpt.

    For example, if you wanted to have list items add the picture first, and then the text, you could override the default order, and have the built-in AutoNav functions called in a different order. Put this in your theme's functions.php:

    remove_all_filters('autonav_create_list_item'); add_filter('autonav_create_list_item', 'an_create_output_picture', 10, 4); add_filter('autonav_create_list_item', 'an_create_output_text', 15, 4); add_filter('autonav_create_list_item', 'an_create_output_excerpt', 20, 4);

  • $html = apply_filters('autonav_create_page_links', $html, $class, $total_pages, $cur_page) -- is called in the case of a multi-page display. Again you may wish to append, prepend, or replace.

  • $html = apply_filters('autonav_html', $html, $attr); Permits you to filter the final HTML which AutoNav generates.

  • $html = apply_filters('autonav_missing_image', $html, $pic); Filter for the text or HTML that will be displayed in the case of a missing image. You can adapt or replace the standard text according to what picture is missing.

You can hook into any or all of these as in the example below. This code simply displays the contents of the attributes array, so you can see how it works:

function show_the_attrs ($attr) {
  print "foo";
  print "<br><pre>";
  print "</pre><br><hr>";
  return $attr;

add_filter('autonav_select', 'show_the_attrs', 10, 1);

Here is an example of adding information to the table output; it appends the (reformatted) date but only to posts. Note that $pic['page'] is the post/page object from WP_Query.

function my_create_output_date ($html, $class, $pic, $attr) {
  if (is_object($pic['page'])) {
    if ($pic['page']->post_type == 'post' && 
      strlen($pic['page']->post_date)) {
      $html .= '<p class="' . $class . '-date">' . 
        mysql2date('j M Y', $pic['page']->post_date) . "</p>\n";
  return $html;

add_filter('autonav_create_table_item', 'my_create_output_date', 18, 4);

Does this plugin create database tables?

No, only the one entry which holds the settings. This is in the wp_options table, with option_name = "autonav_wl" and that will be updated by going through the AutoNav administration screen (see above).

I get an error that imagecreatefromjpeg is not defined

Your webserver needs GD image support in PHP. On Debian or Ubuntu, you can install that with apt-get, and then restart Apache. For example:

$ sudo apt-get install php5-gd
$ sudo /etc/init.d/apache2 restart

Other Recommendations for Accompanying Plugins

  • Pagemash and postmash (see above) rearrange the order of posts and pages.

  • J. Christopher's Attachments plugin lets you attach anything in Wordpress's Media Gallery to any post. See: http://wordpress.org/extend/plugins/attachments

  • Dion Hulse's Add From Server plugin makes it easy to upload images to your server with FTP and them add them directly into WordPress as attachments. In most cases this is now preferable to using AutoNav's "Gallery" mode. http://wordpress.org/extend/plugins/add-from-server/

  • The Media Tags plugin lets you add tags to attachments. For example, if a post has twelve attachments, you could tag three of them with 'dessert' and then display only those: [autonav display="attached" postid="tag:dessert"] Note You must configure the attachment tag taxonomy in the AutoNav settings screen.

  • The Attachment Taxonomy plugin gives you both tags and categories for attachments, so for example: [autonav display="attached" postid="-1,category:chocolate"] to display all attachments from any post in the "chocolate" attachment category. Note You must configure the attachment tag taxonomy in the AutoNav settings screen.

  • The Change Attachment Parent plugin is an easy way to reset the parent page or post for any attachment. Or try the Bulk Change Attachment Parent plugin which adds the feature to the attachment's Actions admin dropdown.

Requires: 3.5 or higher
Compatible up to: 4.2.11
Last Updated: 2 years ago
Active Installs: 1,000+


4.5 out of 5 stars


Got something to say? Need help?


Not enough data

0 people say it works.
0 people say it's broken.

0,1,0 100,2,2 100,1,1 100,2,2
100,1,1 100,1,1
50,2,1 100,2,2 100,2,2 100,1,1 67,3,2
100,1,1 100,1,1
100,1,1 100,1,1
100,2,2 100,2,2
100,1,1 100,1,1
100,2,2 100,3,3
100,1,1 67,3,2
100,1,1 100,1,1 100,1,1 100,1,1 67,3,2
100,1,1 0,1,0
100,1,1 100,1,1