hyunsupul/aesop-core

Modify articles collection author name display

Opened this issue · 5 comments

I'm planing to use this plugin on a website with posts written by multiple authors. So i need access to post author name rendered by the collections component.

I think that something like that could be perfect :
Modify aesop-core/public/includes/components/component-collections.php line 121
from actualy :
<p class="aesop-collection-meta">Written by <?php echo get_the_author();?></p>
to probably something like this :
<p class="aesop-collection-meta"><?php printf( __( 'Written by %s', 'aesop-core' ), apply_filters( 'aesop_collection_author', get_the_author(), get_the_ID() ) );?></p>

Then, for exemple, I'm planing to use it that way with the "Co-Authors Plus" plugin :

    // Allow multiple authors in collection articles meta
    add_filter( 'aesop_collection_author', 'collection_post_authors' );

    function collection_post_authors( $author ) {
        if ( ! function_exists( 'coauthors' ) )
            return $author;

        return coauthors( ', ', __( ' and ','theme-language-string' ), null, null, false );
    }

Hope that makes sense :)

Thank you.

Are you wanting us to add this to Aesop core?

Hi,

If you could add this 'aesop_collection_author' filter to the core, it would be nice. What do think about it ? In the meantime, on my current project, I just removed the author name with css display: none;

Thanks.

Send us a pull request and we will check it out 😄.

Hummm... I'm not sure how to do that... I did "something" on the dev branch but I must say that i'm not "realy" familiar with github :(

Here are a few great articles on how to go about submitting a pull request:

Also, see our contributor page here.