WordPress.org

Ready to get started?Download WordPress

Forums

AutoNav Graphical Navigation and Gallery Plugin
[resolved] Add creation date of page (8 posts)

  1. infohowdy
    Member
    Posted 3 years ago #

    Hello, I use autonav for subpage navigation.

    <?php print autonav_wl_shortcode(array('display'=>'list,thumb,excerpt',
    'start'=>$image_start, 'count'=>4,'size' => '188x188', 'postid' => 1, 'titles'=>'1' )); ?>

    How I can add the creation date of pages?

    http://wordpress.org/extend/plugins/autonav/

  2. wlindley
    Member
    Plugin Author

    Posted 3 years ago #

    Right now you would have to modify the code, but the next version will permit extensions like this through the use of filters. Please email me if you would like to beta-test.

  3. wlindley
    Member
    Plugin Author

    Posted 3 years ago #

    Here is how you would do this from your code, with the next version of AutoNav:

    [Code moderated as per the Forum Rules. Please use the pastebin]

  4. wlindley
    Member
    Plugin Author

    Posted 3 years ago #

    Ugh, when did that "forum rule" crop up? Irritating. Anyway you will be able to define a function which will add the date, but only to posts not pages:

    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;
      }

    and then add it into the filter list after the image and the title but before the excerpt:

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

  5. infohowdy
    Member
    Posted 3 years ago #

    Hello Wlindley, I thankyou very much !!! This is exactly what I mean !!!
    Thankyou !!! :-)

  6. wlindley
    Member
    Plugin Author

    Posted 3 years ago #

    Please try this and advise. There is a whole new section on filters in the Readme.

  7. wlindley
    Member
    Plugin Author

    Posted 2 years ago #

    A more detailed explanation, and a few other examples, are here.

  8. infohowdy
    Member
    Posted 2 years ago #

    Thankyou again

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags