Compare commits

...

4 Commits

Author SHA1 Message Date
ulaulaman 01bf0caf18 Update readme with link to current release 2021-10-13 13:06:54 +02:00
ulaulaman 97741506b8 Update readme 2021-10-13 13:02:34 +02:00
ulaulaman af4d254a68 Update to Wordpress version 2021-10-13 13:02:25 +02:00
ulaulaman a0215dc183 Pulizia 2021-10-13 13:01:57 +02:00
4 changed files with 77 additions and 68 deletions

View File

@ -1,4 +1,4 @@
The plugin add a widget and a shortcode in order to show authors of an article. It is compatible with Co-Authors Plus, but it is not strictly required The plugin add a widget and a shortcode in order to show authors of an article. It is compatible with Co-Authors Plus, but it is not strictly required.
# Description # Description
[Co-Authors Plus](https://wordpress.org/plugins/co-authors-plus/) is one of the most useful plugin for multiple authors blogs: using it you can add more than one author to your posts and you can define also guest authors without user creation. Despite this, not all themes are able to show all the authors of a post or to show the avatar of the guest author. This plugin add a widget to show users' avatars to post also for guest authors and for posts with multiple authors. [Co-Authors Plus](https://wordpress.org/plugins/co-authors-plus/) is one of the most useful plugin for multiple authors blogs: using it you can add more than one author to your posts and you can define also guest authors without user creation. Despite this, not all themes are able to show all the authors of a post or to show the avatar of the guest author. This plugin add a widget to show users' avatars to post also for guest authors and for posts with multiple authors.
@ -6,21 +6,32 @@ You can also add avatars using the shordcode [blog-post-coauthors].
The plugin add also a slider in order to show user's profile. If you want change the style, you can modify blog-spoiler.css file in the plugin folder. The plugin add also a slider in order to show user's profile. If you want change the style, you can modify blog-spoiler.css file in the plugin folder.
# Installation # Installation
1. Extract the widget-for-coauthors.zip file and upload its contents to the /wp-content/plugins/ directory. Alternately, you can install directly from the Plugin directory within your WordPress Install. 1. Extract the widget-for-coauthors.zip file (see the **Current release** section) and upload its contents to the /wp-content/plugins/ directory. Alternately, you can install directly from the Plugin directory within your WordPress Install.
2. Activate the plugin through the \"Plugins\" menu in WordPress. 2. Activate the plugin through the \"Plugins\" menu in WordPress.
3. Add the widget to your sidebar or the shortcode to your posts or pages. 3. Add the widget to your sidebar or the shortcode to your posts or pages.
# Changelog # Changelog
0.6 add author's info also in case Co-Authors Plus doesn't installed<br/> * 0.6 extended html class also in case Co-Authors Plus is not installed
0.5.3 add the correct lang files<br/> * 0.5.3 add the correct lang files
0.5.2 fix error code in domain name in widget<br/> * 0.5.2 fix error code in domain name in widget
0.5.1 fix error code in domain name for messages<br/> * 0.5.1 fix error code in domain name for messages
0.5 support for translations<br/> * 0.5 support for translations
0.4 translation italian messages in english<br/> * 0.4 translation italian messages in english
0.3.1 test with wp 4.9.2<br/> * 0.3.1 test with wp 4.9.2
0.3 add profile link and css<br/> * 0.3 add profile link and css
0.2 creation of the widget to show authors' avatars<br/> * 0.2 creation of the widget to show authors' avatars
0.1 creation of the shortcode to add post's authors * 0.1 creation of the shortcode to add post's authors
# Current release
* [0.6](https://github.com/ulaulaman/widget-for-co-authors/releases/download/0.6/widget-for-co-authors.0.6.zip)
## Old releases
* [0.5.3](https://github.com/ulaulaman/widget-for-co-authors/releases/download/0.5.3/widget-for-co-authors.0.5.3.zip)
# Repositories
* [Wordpress page](https://wordpress.org/plugins/widget-for-co-authors/)
* [Developing edition on gitea](https://gitea.it/ulaulaman/widget-for-co-authors-dev)
# Screenshot # Screenshot
<div align="center"><img src="https://github.com/ulaulaman/widget-for-co-authors/blob/master/assets/screenshot-1.jpg?raw=true" /><br/> <div align="center"><img src="https://github.com/ulaulaman/widget-for-co-authors/blob/master/assets/screenshot-1.jpg?raw=true" /><br/>

View File

@ -1 +0,0 @@
theme: jekyll-theme-leap-day

33
readme.txt Normal file → Executable file
View File

@ -8,29 +8,30 @@ Stable tag: trunk
License: GPLv2 or later License: GPLv2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html License URI: http://www.gnu.org/licenses/gpl-2.0.html
The plugin add a widget and a shortcode in order to show authors of an article. It is compatible with Co-Authors Plus, but it is not strictly required. The plugin add a widget and a shortcode in order to show authors of an article. It is compatible with Co-Authors Plus.
== Description == == Description ==
[Co-Authors Plus](https://wordpress.org/plugins/co-authors-plus/) is one of the most useful plugin for multiple authors blogs: using it you can add more than one author to your posts and you can define also guest authors without user creation. Despite this, not all themes are able to show all the authors of a post or to show the avatar of the guest author. This plugin add a widget to show users' avatars to post also for guest authors and for posts with multiple authors. [Co-Authors Plus](https://wordpress.org/plugins/co-authors-plus/) is one of the most useful plugin for multiple authors blogs. This plugin add a widget to add users' avatars to post also for guest authors and for posts with multiple authors.
You can also add avatars using the shordcode [blog-post-coauthors]. You can also add avatars with a shordcode [blog-post-coauthors].
The plugin add also a slider in order to show user's profile. If you want change the style, you can modify blog-spoiler.css file in the plugin folder. The plugin add also a slider in order to show user's profile. If you want change the style, you can modify blog-spoiler.css file in the plugin folder.
== Installation == == Installation ==
1. Extract the widget-for-coauthors.zip file and upload its contents to the /wp-content/plugins/ directory. Alternately, you can install directly from the Plugin directory within your WordPress Install. 1. Make sure that Co-Authors Plus is installed and active.
2. Activate the plugin through the "Plugins" menu in WordPress. 2. Extract the widget-for-coauthors.zip file and upload its contents to the /wp-content/plugins/ directory. Alternately, you can install directly from the Plugin directory within your WordPress Install.
3. Add the widget to your sidebar or the shortcode to your posts or pages. 3. Activate the plugin through the "Plugins" menu in WordPress.
4. Add the widget to your sidebar or the shortcode to your posts or pages.
== Screenshots == == Screenshots ==
1. The result of the widget in a multiple authors post (italian language) 1. The result of the widget in a multiple authors post (italian language)
== Changelog == == Changelog ==
0.6 add author's info also in case Co-Authors Plus doesn't installed * 0.6 extended html class also in case Co-Authors Plus is not installed
0.5.3 add the correct lang files * 0.5.3 add the correct lang files
0.5.2 fix error code in domain name in widget * 0.5.2 fix error code in domain name in widget
0.5.1 fix error code in domain name for messages * 0.5.1 fix error code in domain name for messages
0.5 support for translations * 0.5 support for translations
0.4 translation italian messages in english * 0.4 translation italian messages in english
0.3.1 test with wp 4.9.2 * 0.3.1 test with wp 4.9.2
0.3 add profile link and css * 0.3 add profile link and css
0.2 creation of the widget to show authors' avatars * 0.2 creation of the widget to show authors' avatars
0.1 creation of the shortcode to add post's authors * 0.1 creation of the shortcode to add post's authors

76
widget-for-co-authors.php Normal file → Executable file
View File

@ -1,11 +1,11 @@
<?php <?php
/* /*
Plugin Name: Co-Authors Widget Dev Plugin Name: Co-Authors Widget
Description: The plugin add a widget and a shortcode in order to show authors of an article. It is compatible with Co-Authors Plus. Description: The plugin add a widget and a shortcode in order to show authors of an article. It is compatible with Co-Authors Plus.
Version: 0.6 Version: 0.6
Author: Gianluigi Filippelli Author: Gianluigi Filippelli
Author URI: http://dropseaofulaula.blogspot.it/ Author URI: http://dropseaofulaula.blogspot.it/
Plugin URI: https://github.com/ulaulaman/widget-for-co-authors Plugin URI: https://ulaulaman.github.io/#CoAuthorsWidget
License: GPLv2 or later License: GPLv2 or later
*/ */
/* ------------------------------------------------------ */ /* ------------------------------------------------------ */
@ -25,55 +25,53 @@ function blog_post_coauthors() {
# Widget to show authors' avatars # Widget to show authors' avatars
function blog_avatars() { function blog_avatars() {
$show_profile = __( 'Show profile', 'widget-for-co-authors' );
$hide_profile = __( 'Hide profile', 'widget-for-co-authors' );
if ( function_exists( 'get_coauthors' ) ) { if ( function_exists( 'get_coauthors' ) ) {
$coauthors = get_coauthors(); $coauthors = get_coauthors();
$user_posts = get_author_posts_url( $coauthor->ID, $coauthor->user_nicename ); $user_posts = get_author_posts_url( $coauthor->ID, $coauthor->user_nicename );
$show_profile = __( 'Show profile', 'widget-for-co-authors' );
$hide_profile = __( 'Hide profile', 'widget-for-co-authors' );
$i = 0; $i = 0;
foreach ( $coauthors as $coauthor ) { foreach ( $coauthors as $coauthor ) {
$i++; $i++;
?> ?>
<div class="block-item-text"> <div class="block-item-text">
<input type="checkbox" hidden class="read-more-state" id="<?php echo $i; ?>"> <input type="checkbox" hidden class="read-more-state" id="<?php echo $i; ?>">
<div class="read-more-wrap"> <div class="read-more-wrap">
<p><?php echo coauthors_get_avatar( $coauthor, 65 ); ?> <p><?php echo coauthors_get_avatar( $coauthor, 65 ); ?>
<a href=<?php echo get_author_posts_url( $coauthor->ID, $coauthor->user_nicename ); ?>><?php echo $coauthor->display_name; ?></a></p> <a href=<?php echo get_author_posts_url( $coauthor->ID, $coauthor->user_nicename ); ?>><?php echo $coauthor->display_name; ?></a></p>
<p class="read-more-target"> <p class="read-more-target">
<?php echo $coauthor->description; ?> <?php echo $coauthor->description; ?>
</p> </p>
</div> </div>
<label for="<?php echo $i; ?>" class="read-more-trigger_closed"> <label for="<?php echo $i; ?>" class="read-more-trigger_closed">
<strong>+ <?php printf( $show_profile ); ?></strong> <strong>+ <?php printf( $show_profile ); ?></strong>
</label> </label>
<label for="<?php echo $i; ?>" class="read-more-trigger_opened"> <label for="<?php echo $i; ?>" class="read-more-trigger_opened">
<strong>- <?php printf( $hide_profile ); ?></strong> <strong>- <?php printf( $hide_profile ); ?></strong>
</label> </label>
</div> </div>
<?php <?php
} }
// //
} else { } else {
$i = 0;
?> ?>
<div class="block-item-text"> <div class="block-item-text">
<input type="checkbox" hidden class="read-more-state" id="<?php echo $i; ?>"> <input type="checkbox" hidden class="read-more-state" id="<?php echo $i; ?>">
<div class="read-more-wrap"> <div class="read-more-wrap">
<p><?php echo get_avatar( get_the_author_meta( 'user_email' ), 65 ); ?> <p><?php echo get_avatar( get_the_author_meta( 'user_email' ), 65 ); ?>
<a href=<?php echo get_the_author_meta( 'user_url' ); ?>><?php echo get_the_author_meta( 'display_name' ); ?></a></p> <a href=<?php echo get_the_author_meta( 'user_url' ); ?>><?php echo get_the_author_meta( 'display_name' ); ?></a></p>
<p class="read-more-target"> <p class="read-more-target">
<?php echo get_the_author_meta( 'description' ); ?> <?php echo get_the_author_meta( 'description' ); ?>
</p> </p>
</div> </div>
<label for="<?php echo $i; ?>" class="read-more-trigger_closed"> <label for="<?php echo $i; ?>" class="read-more-trigger_closed">
<strong>+ <?php printf( $show_profile ); ?></strong> <strong>+ <?php printf( $show_profile ); ?></strong>
</label> </label>
<label for="<?php echo $i; ?>" class="read-more-trigger_opened"> <label for="<?php echo $i; ?>" class="read-more-trigger_opened">
<strong>- <?php printf( $hide_profile ); ?></strong> <strong>- <?php printf( $hide_profile ); ?></strong>
</label> </label>
</div> </div>
<?php <?php
} }
} }