WordPress.org

Plugin Directory

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

Simple Yearly Archive

Simple Yearly Archive is a rather neat and simple WordPress plugin that allows you to display your archives in a year-based list.

How can I change the posts' titles?

Just use the filter sya_the_title. Example: Add the following to your theme's functions.php:

add_filter( 'sya_the_title', 'my_sya_filter_title', 10, 2 );

function my_sya_filter_title( $title, $id ) {
    return $id . ' - ' . $title;
}

This will append the post's ID to the output. This also allows you to append custom taxonomies and more.

How can I change the posts' authors listing (like in supporting the Co-Authors Plus plugin)?

Just use the filter sya_the_authors. Example: Add the following to your theme's functions.php:

if( function_exists('get_coauthors') ) {
    add_filter( 'sya_the_authors', 'my_sya_filter_authors', 10, 2 );
    
    function my_sya_filter_authors( $author, $post ) {
        $coauthors = get_coauthors( $post->ID );
        $authorsCollection = array();
        foreach( $coauthors as $coauthor ) {
            if( $coauthor->display_name ) {
                $authorsCollection[] = $coauthor->display_name;
            }
        }
        return implode(', ', $authorsCollection);
    }
}

How can I change query parameters?

Just use the filter sya_get_posts that allows you to query for literally anything using WP_Query parameters. Add the following snippets to your theme's functions.php.

Display posts that have "either" of these tags

add_filter( 'sya_get_posts', function() {
    return array(
        'tag' => 'bread,baking'
    );
});

Display posts that match the search term "keyword"

add_filter( 'sya_get_posts', function() {
    return array(
        's' => 'keyword'
    );
});

Display only password protected posts

add_filter( 'sya_get_posts', function() {
    return array(
        'has_password' => true
    );
});

Display only 10 posts

add_filter( 'sya_get_posts', function() {
    return array(
        'numberposts' => 10
    );
});

Display posts tagged with bob, under people custom taxonomy

add_filter( 'sya_get_posts', function() {
    return array(
        'tax_query' => array(
            array(
                'taxonomy' => 'people',
                'field'    => 'slug',
                'terms'    => 'bob',
            )
        )
    );
});

Display posts from several custom taxonomies

add_filter( 'sya_get_posts', function() {
    return array(
        'tax_query' => array(
            'relation' => 'AND',
            array(
                'taxonomy' => 'movie_genre',
                'field'    => 'slug',
                'terms'    => array( 'action', 'comedy' ),
            ),
            array(
                'taxonomy' => 'actor',
                'field'    => 'term_id',
                'terms'    => array( 103, 115, 206 ),
                'operator' => 'NOT IN',
            ),
        )
    );
});

Display posts that are in the quotes category OR have the quote format

add_filter( 'sya_get_posts', function() {
    return array(
        'tax_query' => array(
            'relation' => 'OR',
            array(
                'taxonomy' => 'category',
                'field'    => 'slug',
                'terms'    => array( 'quotes' ),
            ),
            array(
                'taxonomy' => 'post_format',
                'field'    => 'slug',
                'terms'    => array( 'post-format-quote' ),
            ),
        )
    );
});

Display posts that are in the quotes category OR both have the quote post format AND are in the wisdom category

add_filter( 'sya_get_posts', function() {
    return array(
        'tax_query' => array(
            'relation' => 'OR',
            array(
                'taxonomy' => 'category',
                'field'    => 'slug',
                'terms'    => array( 'quotes' )
            ),
            array(
                'relation' => 'AND',
                array(
                    'taxonomy' => 'post_format',
                    'field'    => 'slug',
                    'terms'    => array( 'post-format-quote' )
                ),
                array(
                    'taxonomy' => 'category',
                    'field'    => 'slug',
                    'terms'    => array( 'wisdom' ),
                )
            )
        )
    );
});

Configuration? Parameters? Head over here

Requires: 3.7 or higher
Compatible up to: 4.7.9999
Last Updated: 1 month ago
Active Installs: 4,000+

Ratings

5 out of 5 stars

Support

3 of 3 support threads in the last two months have been marked resolved.

Got something to say? Need help?

Compatibility

+
=
Not enough data

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

100,1,1 40,5,2
100,1,1 100,2,2
100,3,3
100,1,1
100,1,1
100,1,1 100,1,1
100,1,1
100,1,1 33,3,1 50,2,1 50,2,1 100,1,1 100,1,1
100,1,1
0,1,0
100,1,1 100,1,1 100,1,1 100,1,1 100,1,1 100,1,1 100,1,1
100,2,2 100,2,2
100,1,1 100,2,2 100,1,1 0,1,0
100,1,1
100,1,1
100,1,1 100,1,1
100,1,1
100,1,1
100,2,2
100,1,1
100,1,1
100,1,1
100,1,1
100,1,1 100,1,1
100,1,1
100,2,2
100,1,1
100,1,1
100,1,1
100,1,1
100,1,1
100,1,1
100,1,1
50,2,1
100,1,1