Compare commits

...

7 Commits

Author SHA1 Message Date
ulaulaman e906f96f2b Update readme 2021-10-13 01:00:27 +02:00
ulaulaman 84aa3905d0 Update readme 2021-10-13 00:58:45 +02:00
ulaulaman cfb14707dc 2021.1013 - New version 2021-10-13 00:58:27 +02:00
ulaulaman 8c933d19f4 Update avatar style 2021-10-13 00:57:58 +02:00
ulaulaman 27632072d5 Update readme 2021-10-12 15:02:29 +02:00
ulaulaman 96904dafae Update readme 2021-10-12 15:01:18 +02:00
ulaulaman 098a784998 Add new style for avatar 2021-10-12 15:01:10 +02:00
4 changed files with 74 additions and 30 deletions

View File

@ -11,17 +11,25 @@ The plugin add also a slider in order to show user's profile. If you want change
3. Add the widget to your sidebar or the shortcode to your posts or pages.
# Changelog
0.6 add author's info also in case Co-Authors Plus doesn't installed<br/>
0.5.3 add the correct lang files<br/>
0.5.2 fix error code in domain name in widget<br/>
0.5.1 fix error code in domain name for messages<br/>
0.5 support for translations<br/>
0.4 translation italian messages in english<br/>
0.3.1 test with wp 4.9.2<br/>
0.3 add profile link and css<br/>
0.2 creation of the widget to show authors' avatars<br/>
0.1 creation of the shortcode to add post's authors
* 2021.1013
* Add command for version number in css enqueue
* Update style
* 2021.1012 New style for show avatar
* 2021.1007 Best indentation and test new style
## 2020.0922
* 0.6 add author's info also in case Co-Authors Plus doesn't installed
* 0.5.3 add the correct lang files
* 0.5.2 fix error code in domain name in widget
* 0.5.1 fix error code in domain name for messages
* 0.5 support for translations
* 0.4 translation italian messages in english
* 0.3.1 test with wp 4.9.2
* 0.3 add profile link and css
* 0.2 creation of the widget to show authors' avatars
* 0.1 creation of the shortcode to add post's authors
# Screenshot
<div align="center"><img src="https://github.com/ulaulaman/widget-for-co-authors/blob/master/assets/screenshot-1.jpg?raw=true" /><br/>
<em>The result of the widget in a multiple authors post</em></div>
![Screenshot](assets/screenshot-1.jpg)
<div align="center"><em>The result of the widget in a multiple authors post</em></div>

View File

@ -9,3 +9,28 @@
.read-more-state:checked ~ .read-more-trigger_closed {
display: none;
}
.avatar {
display: block;
padding: 3px;
margin-left: auto;
margin-right: auto;
vertical-align: baseline;
font: 11px/1.4em Arial, sans-serif;
text-align: center;
vertical-align: baseline;
}
.avatarimg {
vertical-align:middle;
margin-bottom: 3px;
width:92%;
}
.right {
float:right;
}
.left {
float:left;
}

View File

@ -24,13 +24,18 @@ The plugin add also a slider in order to show user's profile. If you want change
1. The result of the widget in a multiple authors post (italian language)
== Changelog ==
0.6 add author's info also in case Co-Authors Plus doesn't installed
0.5.3 add the correct lang files
0.5.2 fix error code in domain name in widget
0.5.1 fix error code in domain name for messages
0.5 support for translations
0.4 translation italian messages in english
0.3.1 test with wp 4.9.2
0.3 add profile link and css
0.2 creation of the widget to show authors' avatars
0.1 creation of the shortcode to add post's authors
* 2021.1013
* Add command for version number in css enqueue
* Update style
* 2021.1012 New style for show avatar
* 2021.1007 Best indentation and test new style
* 0.6 add author's info also in case Co-Authors Plus doesn't installed
* 0.5.3 add the correct lang files
* 0.5.2 fix error code in domain name in widget
* 0.5.1 fix error code in domain name for messages
* 0.5 support for translations
* 0.4 translation italian messages in english
* 0.3.1 test with wp 4.9.2
* 0.3 add profile link and css
* 0.2 creation of the widget to show authors' avatars
* 0.1 creation of the shortcode to add post's authors

View File

@ -2,7 +2,7 @@
/*
Plugin Name: Co-Authors Widget Dev
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: 2021.1008
Version: 2021.1012
Author: Gianluigi Filippelli
Author URI: http://dropseaofulaula.blogspot.it/
Plugin URI: https://gitea.it/ulaulaman/widget-for-co-authors-dev
@ -10,9 +10,6 @@ Gitea Plugin URI: https://gitea.it/ulaulaman/widget-for-co-authors-dev
License: GPLv2 or later
*/
/* ------------------------------------------------------ */
# ---------------------------------------------------------
// Load translations
add_action( 'plugins_loaded', 'caw_load_translations' );
function caw_load_translations() {
@ -42,8 +39,12 @@ function blog_avatars() {
<div class="block-item-text">
<input type="checkbox" hidden class="read-more-state" id="<?php echo $i; ?>" />
<div class="read-more-wrap">
<p><div style="float:left; padding: 5px;"><?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></div><span class="read-more-target"><?php echo $coauthor->description; ?></span></p>
<div class="avatar">
<div class="avatarimg left" style="width:50%;"><?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>
</div>
<span class="read-more-target"><?php echo $coauthor->description; ?></span>
</div>
</div>
<label for="<?php echo $i; ?>" class="read-more-trigger_closed">
<strong>+ <?php printf( $show_profile ); ?></strong>
@ -60,7 +61,12 @@ function blog_avatars() {
<div class="block-item-text">
<input type="checkbox" hidden class="read-more-state" id="<?php echo $i; ?>" />
<div class="read-more-wrap">
<p><div style="float:left; padding: 5px;"><?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></div><span class="read-more-target"><?php echo get_the_author_meta( 'description' ); ?></span></p>
<div class="avatar">
<div class="avatarimg left"><?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>
</div>
<span class="read-more-target"><?php echo get_the_author_meta( 'description' ); ?></span>
</div>
</div>
<label for="<?php echo $i; ?>" class="read-more-trigger_closed">
<strong>+ <?php printf( $show_profile ); ?></strong>
@ -74,7 +80,7 @@ function blog_avatars() {
}
function blog_enqueue() {
wp_register_style( 'blog-spoiler-style', plugins_url('/blog-spoiler.css', __FILE__) );
wp_register_style( 'blog-spoiler-style', plugins_url('/blog-spoiler.css', __FILE__), rand(111,9999), '1' );
wp_enqueue_style( 'blog-spoiler-style' );
}
add_action( 'wp_enqueue_scripts', 'blog_enqueue' );