Plugin Directory

Changeset 2506644


Ignore:
Timestamp:
03/31/2021 10:50:02 AM (5 years ago)
Author:
aurelienpierre
Message:

Version 1.0

Location:
photographers-galleries/trunk
Files:
1 deleted
4 edited

Legend:

Unmodified
Added
Removed
  • photographers-galleries/trunk/css/pg-style.css

    r1404381 r2506644  
    1 /* Galleries layout */
     1.gallery-columns-1 {
     2  column-count: 1;
     3}
     4.gallery-columns-2 {
     5  column-count: 2;
     6}
     7.gallery-columns-3 {
     8  column-count: 3;
     9}
     10.gallery-columns-4 {
     11  column-count: 4;
     12}
     13.gallery-columns-5 {
     14  column-count: 5;
     15}
     16.gallery-columns-6 {
     17  column-count: 6;
     18}
     19.gallery-columns-7 {
     20  column-count: 7;
     21}
     22.gallery-columns-8 {
     23  column-count: 8;
     24}
     25.gallery-columns-9 {
     26  column-count: 9;
     27}
    228
    329.gallery {
    4         width: 100%;
    5         display: table;
    6         max-width: 100%;
    7 }
    8 
    9 .gallery .gallery-item {
    10         box-sizing: border-box;
    11         margin: 0;
    12         padding: 2px;
    13         display: inline-table;
    14         text-align: center;
    15 }
    16 
    17 .gallery-columns-2 .gallery-item {
    18         width: 50%;
    19         max-width: 50%;
    20 }
    21 .gallery-columns-3 .gallery-item {
    22         width: 33.33%;
    23         max-width: 33.33%;
    24 }
    25 .gallery-columns-4 .gallery-item {
    26         width: 25%;
    27         max-width: 25%;
    28 }
    29 .gallery-columns-5 .gallery-item {
    30         width: 20%;
    31         max-width: 20%;
    32 }
    33 .gallery-columns-6 .gallery-item {
    34         width: 16.67%;
    35         max-width: 16.67%;
    36 }
    37 .gallery-columns-7 .gallery-item {
    38         width: 14.28%;
    39         max-width: 14.28%;
    40 }
    41 .gallery-columns-8 .gallery-item {
    42         width: 12.5%;
    43         max-width: 12.5%;
    44 }
    45 .gallery-columns-9 .gallery-item {
    46         width: 11.11%;
    47         max-width: 11.11%;
    48 }
    49 
    50 .gallery img {
    51         max-width: none;
    52         width: 100%;
    53         height: auto;
     30  column-gap: 10px;
     31}
     32
     33.gallery figure {
     34  margin-bottom: 10px;
     35  break-after: column;
    5436}
    5537
    5638.wp-caption-text {
    57         padding: 1ex;
    58         font-size: 0.9em;
    59         color: #666;
    60         text-align: center;
     39  white-space: normal;
     40  display: block;
    6141}
    6242
     
    6444
    6545.pg-align_caption .gallery {
    66         display: grid;
    67 }
    68 
    69 .pg-align_caption .gallery .gallery-item {
    70         display: inline-block;
     46  display: grid;
    7147}
    7248
     
    7450
    7551.pg-no_caption .wp-caption-text {
    76         display: none;
    77         padding: 0;
    78 }
    79 
    80 .pg-carousel-wrapper .pg-no_caption img { 
    81         height: calc(100vh - 50px);
     52  display: none;
     53  padding: 0;
     54}
     55
     56.pg-carousel-wrapper .pg-no_caption img {
     57  height: calc(100vh - 50px);
    8258}
    8359
    8460/* HOVER CAPTION */
    8561
    86 @media screen and (min-width: 799px) {
    87 
    88         .pg-hover_caption .wp-caption-text {
    89                 position: absolute;
    90                 bottom: 0;
    91                 left: 0;
    92                 right: 0;
    93                 display: none;
    94                 background: rgba(255, 255, 255, 0.75);
    95                 z-index:9999;
    96                 color: black;
    97         }
    98 
    99         .pg-hover_caption .gallery-item:hover .wp-caption-text,
    100         .pg-hover_caption .gallery-item:focus .wp-caption-text,
    101         .pg-hover_caption .gallery-item:active .wp-caption-text {
    102                 display: block;
    103         }
    104 
    105         .pg-hover_caption .gallery img {
    106                 height: calc(100vh - 50px);
    107         }
    108 
    109 }
    110 
    111 /* CAROUSEL */
     62.pg-hover_caption .wp-caption-text {
     63  position: absolute;
     64  bottom: 0;
     65  left: 0;
     66  right: 0;
     67  display: none;
     68  background: rgba(255, 255, 255, 0.75);
     69  z-index:9999;
     70  color: black;
     71  text-align: center;
     72}
     73
     74.pg-hover_caption .gallery-item:hover .wp-caption-text,
     75.pg-hover_caption .gallery-item:focus .wp-caption-text,
     76.pg-hover_caption .gallery-item:active .wp-caption-text {
     77  display: block;
     78}
     79
     80.pg-hover_caption .gallery img {
     81  height: calc(100vh - 50px);
     82}
     83
     84/* CAROUSEL AND EXHIBITION BASICS */
     85
     86html {
     87  scroll-snap-type: block proximity;
     88  scroll-behavior: smooth;
     89}
     90
     91.pg-exhibition-wrapper {
     92  scroll-snap-align: start;
     93  scroll-snap-stop: always;
     94}
    11295
    11396.pg-carousel-wrapper {
    114         position: relative;
    115 }
    116 
    117 .pg-carousel {
    118         width: 100%;
    119         height: auto;
    120         overflow-x: scroll;
    121     overflow-y: hidden;
     97  scroll-snap-align: center;
     98  scroll-snap-stop: always;
     99}
     100
     101.pg-carousel .gallery figure.gallery-item,
     102.pg-exhibition .gallery figure.gallery-item,
     103.pg-carousel .gallery figure.gallery-item .gallery-icon,
     104.pg-exhibition .gallery figure.gallery-item .gallery-icon,
     105.pg-carousel .gallery figure.gallery-item .gallery-icon img,
     106.pg-exhibition .gallery figure.gallery-item .gallery-icon img,
     107.pg-carousel .gallery figure.gallery-item figcaption.wp-caption-text,
     108.pg-exhibition .gallery figure.gallery-item figcaption.wp-caption-text {
     109  /* nuke theme borders */
     110  border: none;
     111}
     112
     113.pg-carousel .wp-caption-text, .pg-exhibition .wp-caption-text {
     114  text-align: right;
     115}
     116
     117.pg-carousel.pg-hover_caption .wp-caption-text,
     118.pg-exhibition.pg-hover_caption .wp-caption-text {
     119  text-align: center;
     120}
     121
     122.pg-carousel-wrapper, .pg-exhibition-wrapper {
     123  box-sizing: border-box;
     124  display: block;
     125  max-height: 100vh;
     126  max-width: 100vw;
     127  width: 100%;
     128  height: 100%;
     129  overflow: hidden;
     130  position: relative;
     131}
     132
     133.pg-exhibition-wrapper {
     134  height: 100vh;
     135}
     136
     137.pg-carousel, .pg-exhibition {
     138  width: 100%;
     139  height: 100%;
     140  display: block;
     141  overflow-x: scroll;
     142  overflow-y: visible;
     143  -ms-overflow-style: none;  /* IE and Edge */
     144  scrollbar-width: none;  /* Firefox */
     145  touch-action: pan-x;
     146  padding: 0;
     147  box-sizing: border-box;
     148  transition: transform .5s ease-out;
     149}
     150
     151.pg-exhibition {
     152  padding: 4em;
    122153}
    123154
    124155.pg-carousel header {
    125         position: absolute;
    126         font-size: 1.1em;
    127         display: block;
    128         z-index:9999;
    129         font-variant: small-caps;
    130         -moz-font-feature-settings: 'smcp' on;
    131         -webkit-font-feature-settings: 'smcp' on;
    132         -ms-font-feature-settings: 'smcp' on;
    133         font-feature-settings: 'smcp' on;
    134 }
    135 
    136 @media screen and (min-width: 800px) {
    137 
    138         .pg-carousel header {
    139                 top: 0;
    140                 left: 0;
    141                 right: 0;
    142                 background: linear-gradient(to right, rgba(0, 0, 0, 0.9) 0%, rgba(0, 0, 0, 0)75%);
    143                 padding: 0.5ex 1ex 1ex 1ex;
    144                 color: #f2f2f2;
    145         }
    146 
    147         .pg-carousel:hover header,
    148         .pg-carousel:focus header,
    149         .pg-carousel:active header {
    150                 display: none;
    151         }
    152 }
    153 
    154 @media (max-width: 799px) {
    155 
    156         .pg-carousel header {
    157                 top: -2em;
    158                 left: 0;
    159                 right: 0;
    160                 padding: 0.5ex 0;
    161                 color: #333;
    162         }
    163         .pg-carousel-wrapper {
    164                 margin-top: 4em;
    165         }
    166 }
    167 
    168 .pg-carousel .gallery {
    169         display: inline;
    170         height: 100%!important;
    171         width: auto;
    172         max-width: none;
    173         max-height: 100vh;
    174         overflow: hidden;
    175         white-space: nowrap;
    176         position: relative;
    177         margin: -2px -2px 0 -2px;
    178         padding-right: -10px;
    179 }
    180 
    181 .pg-carousel .gallery-item {
    182         display: inline-table!important;
    183         float: none;
    184         white-space: normal;
    185         width: auto!important;
    186         height: 100%;
    187         margin: 0;
    188         padding: 0 4px 0 0;
    189         position: relative;
    190 }
    191 
    192 .pg-carousel .gallery img {
    193         max-height: 100%;
    194         width: auto;
    195         height: 91vh; /* for older browsers compatibility */
    196         height: calc(100vh - 0.9em - 2ex - 50px);
    197         max-width: none;
    198 }
     156  position: absolute;
     157  font-size: 1.1em;
     158  display: block;
     159  z-index:9999;
     160  font-variant: small-caps;
     161  -moz-font-feature-settings: 'smcp' on;
     162  -webkit-font-feature-settings: 'smcp' on;
     163  -ms-font-feature-settings: 'smcp' on;
     164  font-feature-settings: 'smcp' on;
     165}
     166
     167.pg-carousel header {
     168  top: 0;
     169  left: 0;
     170  right: 0;
     171  background: linear-gradient(to right, rgba(0, 0, 0, 0.9) 0%, rgba(0, 0, 0, 0)75%);
     172  padding: 0.5ex 1ex 1ex 1ex;
     173  color: #f2f2f2;
     174}
     175
     176.pg-carousel:hover header,
     177.pg-carousel:focus header,
     178.pg-carousel:active header {
     179  display: none;
     180}
     181
     182.pg-carousel .gallery {
     183  display: table;
     184  height: 100%;
     185  width: 100%;
     186  white-space: nowrap;
     187  position: relative;
     188  margin: 10px -20px 10px -10px;
     189  padding: 0;
     190  box-sizing: border-box;
     191  overflow: visible;
     192}
     193
     194.pg-exhibition .gallery,
     195.pg-exhibition .gallery * {
     196  display: flex;
     197  justify-content: center;
     198  width: auto;
     199  height: auto;
     200  margin: 0;
     201  padding: 0;
     202  position: relative;
     203  box-sizing: border-box;
     204}
     205
     206.pg-exhibition.pg-no_caption .gallery .wp-caption-text {
     207  display: none;
     208}
     209
     210.pg-exhibition .gallery .wp-caption-text {
     211  display: block;
     212  text-align: right;
     213  line-height: 2;
     214  margin-top: 1em;
     215}
     216
     217.pg-exhibition .gallery {
     218  flex-direction: row;
     219  align-items: center;
     220  overflow: visible;
     221  height: 100%;
     222  width: 100%;
     223  max-width: 100vw;
     224  max-height: 100vh;
     225}
     226
     227.pg-carousel .gallery .gallery-item {
     228  display: inline-table;
     229  float: none;
     230  white-space: normal;
     231  width: auto;
     232  height: 100%;
     233  padding: 0;
     234  margin: 0 10px;
     235  position: relative;
     236  box-sizing: border-box;
     237  border: none;
     238}
     239
     240.pg-exhibition .gallery .gallery-item {
     241  display: none;
     242  flex-direction: column;
     243  align-items: center;
     244  overflow: visible;
     245}
     246
     247.pg-exhibition-wrapper .gallery .gallery-icon {
     248  overflow: hidden;
     249}
     250
     251.pg-exhibition .gallery figure.active {
     252  display: flex;
     253}
     254
     255.pg-carousel .gallery .gallery-item:first-child {
     256  margin-left: 0px;
     257}
     258
     259.pg-carousel .gallery .gallery-item:last-child {
     260  margin-right: 0px;
     261}
     262
     263.pg-carousel .gallery img {
     264  max-height: calc(90vh - 40px);
     265  max-width: none;
     266  min-width: 150px;
     267  min-height: 150px;
     268  width: auto;
     269  height: calc(90vh - 40px);
     270  box-sizing: border-box;
     271  border: none;
     272  pointer-events: none;
     273}
     274
     275.pg-exhibition .gallery img {
     276  display: inline-flex;
     277  align-self: center;
     278  max-width: none;
     279  max-height: none;
     280  pointer-events: none;
     281}
     282
     283
     284/* Looks */
     285
     286.pg-exhibition-wrapper .look-modern,
     287.pg-exhibition-wrapper .look-classic,
     288.pg-exhibition-wrapper .look-box,
     289.pg-exhibition-wrapper .look-box-dark,
     290
     291.pg-exhibition-wrapper .look-box-bright {
     292  background: linear-gradient(180deg, rgb(255, 255, 255), rgba(0, 0, 0, 0.005)),
     293  radial-gradient(circle at center, rgb(255, 255, 255) 0,
     294  rgba(255, 255, 255, 0.5) 50%,
     295  rgba(200, 200, 200, 0.67) 67%,
     296  rgba(200, 200, 200, 0.75) 75%,
     297  rgb(255, 255, 255) 100%);
     298}
     299
     300.pg-no_caption.look-classic .pg-exhibition,
     301.pg-no_caption.look-box .pg-exhibition,
     302.pg-no_caption.look-box-bright .pg-exhibition,
     303.pg-no_caption.look-box-dark .pg-exhibition {
     304  padding: 4em;
     305}
     306
     307.pg-show_caption.look-classic .pg-exhibition,
     308.pg-show_caption.look-box .pg-exhibition,
     309.pg-show_caption.look-box-bright .pg-exhibition,
     310.pg-show_caption.look-box-dark .pg-exhibition {
     311  padding: 6em;
     312}
     313
     314.pg-exhibition-wrapper .look-modern .gallery .gallery-icon {
     315  box-shadow: 0 0.5em 1em rgba(0, 0, 0, 0.25),
     316  0 1em 2em rgba(0, 0, 0, 0.25),
     317  0 0.25em 0.5em rgba(0, 0, 0, 0.25);
     318}
     319
     320.pg-exhibition-wrapper .look-classic .gallery figure.gallery-item .gallery-icon {
     321  padding: 1em;
     322  background-color: #ededeb;
     323  border: 0.25em solid #333;
     324  box-shadow: 0 0.5em 1em rgba(0, 0, 0, 0.25),
     325              0 1em 2em rgba(0, 0, 0, 0.25),
     326              0 0.25em 0.5em rgba(0, 0, 0, 0.25);
     327}
     328
     329.pg-exhibition-wrapper .look-classic .gallery img {
     330  box-shadow: inset 0px 2px 3px rgba(0, 0, 0, 0.1),inset 0px 2px 2px rgba(0, 0, 0, 0.05);
     331  border-right: 0.1em solid #fcfcfa;
     332  border-left: 0.1em solid #fcfcfa;
     333  border-top: 0.1em solid #f2f2f0;
     334  border-bottom: 0.1em solid #fdfdfb;
     335  padding: 0.15em;
     336  background-color: white;
     337}
     338
     339.pg-exhibition-wrapper .look-box .gallery .gallery-icon,
     340.pg-exhibition-wrapper .look-box-dark .gallery .gallery-icon,
     341.pg-exhibition-wrapper .look-box-bright .gallery .gallery-icon {
     342  padding: 1em;
     343  box-shadow: 0 0.5em 1em rgba(0, 0, 0, 0.25),
     344              0 1em 2em rgba(0, 0, 0, 0.25),
     345              0 0.25em 0.5em rgba(0, 0, 0, 0.25),
     346              inset 0 0.25em 1.5em 0 rgba(0, 0, 0, 0.75);
     347}
     348
     349.pg-exhibition-wrapper .look-box .gallery img,
     350.pg-exhibition-wrapper .look-box-bright .gallery img,
     351.pg-exhibition-wrapper .look-box-dark .gallery img {
     352  box-shadow: 0 0.25em 1em rgba(0, 0, 0, 0.75);
     353}
     354
     355.pg-exhibition-wrapper .look-box .gallery figure.gallery-item .gallery-icon {
     356  background-color: #777;
     357  border: 0.25em solid #666;
     358}
     359
     360.pg-exhibition-wrapper .look-box-dark .gallery figure.gallery-item .gallery-icon {
     361  background-color: #555;
     362  border: 0.25em solid #444;
     363}
     364
     365.pg-exhibition-wrapper .look-box-bright .gallery figure.gallery-item .gallery-icon {
     366  background-color: #999;
     367  border: 0.25em solid #888;
     368}
     369
     370/* Next & previous buttons */
     371.gallery-prev, .gallery-next {
     372  width: 12%;
     373  height: 100%;
     374  position: absolute;
     375  top: 0;
     376  cursor: pointer;
     377  z-index: 999;
     378}
     379
     380.gallery-prev { left: 0; }
     381.gallery-next { right: 0; }
     382
     383.gallery-prev span, .gallery-next span {
     384  cursor: pointer;
     385  position: absolute;
     386  top: 50%;
     387  width: auto;
     388  margin-top: -15px;
     389  padding: 15px;
     390  color: white;
     391  font-weight: bold;
     392  font-size: 20px;
     393  user-select: none;
     394  box-sizing: border-box;
     395  opacity: 50%;
     396}
     397
     398.pg-exhibition .gallery-prev span, .pg-exhibition .gallery-next span {
     399  color: black;
     400}
     401
     402.gallery-next span{
     403  right: 0;
     404}
     405
     406.gallery-prev:hover span, .gallery-next:hover span {
     407  opacity: 100%;
     408}
     409
     410/* On hover, add a black background color with a little bit see-through */
     411a.gallery-prev:hover span, a.gallery-next:hover span {
     412  background-color: rgba(0,0,0,1);
     413  opacity: 100%;
     414  text-transform: none;
     415  text-decoration: none!important;
     416  color: white;
     417}
  • photographers-galleries/trunk/includes/shortcodes.php

    r1404381 r2506644  
    22// If this file is called directly, abort.
    33if ( ! defined( 'WPINC' ) ) {
    4     die;
     4  die;
    55}
    66
    77/*
    8  * Carousel gallery
    9  */
     8* Carousel gallery
     9*/
    1010
    1111function pg_carousel( $atts, $content ){
    12     /**
    13      * This shortcode is just intended to add classes to the gallery wrapper div
    14      * Optionnaly, it adds a custom height and width to the unique carousel
    15      */
    16 
    17     // Set the container ID
    18     new pg_Carousels();
    19     $id = "pg-carousel-" . pg_Carousels::$counter;
    20 
    21 
    22     // Extract the shortcode attributes
    23     $a = shortcode_atts(
    24             array(
    25                     'w' => '',
    26                     'h' => '',
    27                     'align' => 'none',
    28                     'title' => '',
    29                     'caption' => 'below',
    30                     'raw_css' => '',
    31             ),
    32             $atts );
    33 
    34     // Floating options
    35     $class = "align" . $a['align'];
    36 
    37     // Caption style
    38     if ( $a['caption'] == 'below' )     { $class = $class . " pg-show_caption"; }
    39     if ( $a['caption'] == 'hide' )      { $class = $class . " pg-no_caption"; }
    40     if ( $a['caption'] == 'hover' )     { $class = $class . " pg-hover_caption"; }
    41 
    42     // Unique style if given : custom height and width, raw CSS code
    43     $style = '';
    44    
    45     if ( !empty( $a['h'] ) || !empty( $a['w'] ) || !empty( $a['raw_css'] ) ) {
    46         $style = "<style> ";
    47             if ( !empty( $a['h'] ) ) { $style = $style . "#" . $id . " img { height: " . $a['h'] . ";} "; }
    48             if ( !empty( $a['w'] ) ) { $style = $style . "#" . $id . " { width: " . $a['w'] . ";} "; }
    49             $style = $style . $a['raw_css'];
    50         $style = $style . " </style>";
    51     }
    52 
    53     // Open markup
    54     $before = "<div class='pg-carousel-wrapper'><section class='pg-carousel " . $class . "' id='" . $id . "' >";
    55 
    56     // Optional title
    57     if ( !empty($a['title']) ) { $before = $before . "<header>" . $a['title'] . "</header>"; }
    58 
    59     // Content
    60     $inside = do_shortcode( strip_tags( $content ) );
    61 
    62     // Closing markup
    63     $after = "</section></div>";
    64 
    65     return $style . $before . $inside . $after;
    66 }
    67 add_shortcode( 'carousel', 'pg_carousel' );
    68 
     12  /**
     13  * This shortcode is just intended to add classes to the gallery wrapper div
     14  * Optionnaly, it adds a custom height and width to the unique carousel
     15  */
     16
     17  // Set the container ID
     18  new pg_Carousels();
     19  $counter = pg_Carousels::$counter;
     20  $id = "pg-carousel-" . $counter;
     21
     22  // Extract the shortcode attributes
     23  $a = shortcode_atts(
     24    array(
     25      'w' => '',
     26      'h' => '',
     27      'align' => 'none',
     28      'title' => '',
     29      'caption' => 'below',
     30      'raw_css' => '',
     31      'look' => 'default',
     32    ),
     33    $atts );
     34
     35    // Floating options
     36    $class = "align" . $a['align'];
     37
     38    // Caption style
     39    if ( $a['caption'] == 'below' )     { $class = $class . " pg-show_caption"; }
     40    if ( $a['caption'] == 'hide' )      { $class = $class . " pg-no_caption"; }
     41    if ( $a['caption'] == 'hover' )     { $class = $class . " pg-hover_caption"; }
     42    $class .= ' look-'. $a['look'];
     43
     44    // Unique style if given : custom height and width, raw CSS code
     45    $style = '';
     46    $style_wrapper = '';
     47
     48    if ( !empty( $a['h'] ) || !empty( $a['w'] ) || !empty( $a['raw_css'] ) ) {
     49      $style = "<style> ";
     50      if ( !empty( $a['h'] ) ) { $style = $style . "#" . $id . " img { height: " . $a['h'] . ";} "; }
     51      if ( !empty( $a['w'] ) ) { $style_wrapper = "style='width: ". $a['w'] . ";'"; }
     52      $style = $style . $a['raw_css'];
     53      $style = $style . " </style>";
     54    }
     55
     56    // Open markup
     57    $before = "<div class='pg-carousel-wrapper $class' $style_wrapper><section class='pg-carousel $class' id='$id' tabindex='$counter'>";
     58
     59    // Optional title
     60    if ( !empty($a['title']) ) { $before = $before . "<header>" . $a['title'] . "</header>"; }
     61
     62    // Content
     63    $inside = do_shortcode( strip_tags( $content ) );
     64
     65    // Navigation arrows
     66    $nav = "<a class='gallery-prev' onclick='Scroll(-1,\"$id\")'><span>&#10094;</span></a>";
     67    $nav .= "<a class='gallery-next' onclick='Scroll(+1,\"$id\")'><span>&#10095;</span></a>";
     68
     69    // Overlay
     70    $over = "<div style='z-index: 10; position: absolute; top: 0; left: 0; width: 100%; height: 100%'></div>";
     71
     72    // Closing markup
     73    $after = $nav."</section></div>";
     74
     75    // Script
     76    $script = "
     77    <script>
     78    var matte = document.getElementById('$id');
     79    var arrow_left = matte.getElementsByClassName('gallery-prev')[0];
     80    arrow_left.style.display = 'none';
     81    matte.addEventListener('scroll', function(event) { updateArrows(event, '$id'); }, {passive: true});
     82    matte.addEventListener('keydown', function(event) {
     83      if(event.key == 'ArrowLeft') Scroll(-1, '$id');
     84      if(event.key == 'ArrowRight') Scroll(+1, '$id');
     85    });
     86    </script>";
     87
     88    return $style . $before . $inside . $after . $script;
     89  }
     90  add_shortcode( 'carousel', 'pg_carousel' );
    6991
    7092/*
    71  * Gallery with no caption
    72  */
    73 
    74 function pg_no_caption( $atts, $content ){
    75     $before = "<div class='pg-no_caption'>";
    76     $inside = do_shortcode( strip_tags( $content ) );
    77     $after = "</div>";
    78     return $before . $inside . $after;
    79 }
    80 add_shortcode( 'nocaption', 'pg_no_caption' );
    81 
    82 
    83 /*
    84  * Gallery where pictures are aligned along the bottom side
    85  */
    86 
    87 function pg_align_caption( $atts, $content ){
    88     $before = "<div class='pg-align_caption'>";
    89     $inside = do_shortcode( strip_tags( $content ) );
    90     $after = "</div>";
    91     return $before . $inside . $after;
    92 }
    93 add_shortcode( 'aligncaption', 'pg_align_caption' );
    94 
    95 
    96 /*
    97  * Dynamic gallery based on taxonomy
    98  */
    99 
    100 function pg_dynamic_gallery( $atts ){
    101    
    102     // Extract the shortcode attributes
    103     $a = shortcode_atts(
    104             array(  // Plugin specific keys
    105                     'gallery' => '',
    106                     'model' => '',
    107                     'location' => '',
    108                     'exif' => '',
    109                     'author' => '',
    110                     'tag' => '',
    111                     // Standard WP Query keys
    112                     'orderby' => 'date',
    113                     'order' => 'ASC',
    114                     // Stardard WP gallery shortcode keys
    115                     'columns' => '',
    116                     'size' => '',
    117                     'link' => '',
    118                     'type' => '' // for compatibility with Jetpack tiled galleries
    119             ),
    120             $atts );
    121    
    122     // Prepare the query
    123     $args = array(
    124             'post_type' => 'attachment',
    125             'post_parent' => 'null',
    126             'post_per_page' => -1,
    127             'author_name' => $a['author'],
    128             'tag' => $a['tag'],
    129             'orderby' => $a['orderby'],
    130             'order' => $a['order'],
    131             'perm'        => 'readable',
    132             'tax_query' => array('relation' => 'AND'),
    133             'post_mime_type'    => array(
    134                     'image/jpeg',
    135                     'image/jpg',
    136                     'image/gif',
    137                     'image/png',
    138                     'image/bmp'
    139             ),
    140             'fields' => 'ids',
    141     );
    142    
    143     // Add the gallery
    144     if ( !empty( $a['gallery'] ) ) {
    145         $gal = array(
    146             'taxonomy' => 'gallery',
    147             'field'    => 'slug',
    148             'terms'    => $a['gallery']
    149         );
    150         array_push( $args['tax_query'] , $gal);
    151     }
    152    
    153     // Add the model
    154     if ( !empty( $a['model'] ) ) {
    155         $mod = array(
    156             'taxonomy' => 'model',
    157             'field'    => 'slug',
    158             'terms'    => $a['model']
    159         );
    160         array_push( $args['tax_query'] , $mod);
    161        
    162     }
    163    
    164     // Add the location
    165     if ( !empty( $a['location'] ) ) {
    166         $loc = array(
    167             'taxonomy' => 'location',
    168             'field'    => 'slug',
    169             'terms'    => $a['location']
    170         );
    171         array_push( $args['tax_query'] , $loc);
    172     }
    173    
    174     // The query
    175     $images = get_children( $args );
    176 
    177     if ( empty($images) ) {
    178        
    179         return __('No image found', 'photographers-galleries');
    180        
    181     } else {
    182         // Extract the relevant images IDS
    183         $ids = implode ( ',', array_values( $images ) );
    184        
    185         // Build the args array for WP gallery
    186         $args = array(
    187                 'ids' => $ids,
    188                 'size' => $a['size'],
    189                 'columns' => $a['columns'],
    190                 'link' => $a['link'],
    191                 'type' => $a['type'] // for compatibility with Jetpack themes
    192         );
    193        
    194         // Print the standard WP gallery
    195         return gallery_shortcode( $args );
    196     }
    197    
    198     // Restore original Post Data
    199     wp_reset_postdata();
    200    
    201 }
    202 add_shortcode( 'dynamic_gallery', 'pg_dynamic_gallery' );
     93* Exhibition gallery
     94*/
     95function pg_exhibition( $atts, $content ){
     96  /**
     97  * This shortcode is just intended to add classes to the gallery wrapper div
     98  * Optionnaly, it adds a custom height and width to the unique carousel
     99  */
     100
     101  // Set the container ID
     102  new pg_Carousels();
     103  $counter = pg_Carousels::$counter;
     104  $id = "pg-exhibition-" . $counter;
     105
     106  // Extract the shortcode attributes
     107  $a = shortcode_atts(
     108    array(
     109      'w' => '',
     110      'h' => '',
     111      'align' => 'none',
     112      'title' => '',
     113      'caption' => 'below',
     114      'raw_css' => '',
     115      'look' => 'modern',
     116    ),
     117    $atts );
     118
     119    // Floating options
     120    $class = "align" . $a['align'];
     121
     122    // Caption style
     123    if ( $a['caption'] == 'below' )     { $class = $class . " pg-show_caption"; }
     124    if ( $a['caption'] == 'hide' )      { $class = $class . " pg-no_caption"; }
     125    if ( $a['caption'] == 'hover' )     { $class = $class . " pg-hover_caption"; }
     126    $class .= ' look-'. $a['look'];
     127
     128    // Unique style if given : custom height and width, raw CSS code
     129    $style = '';
     130    $style_wrapper = '';
     131
     132    if ( !empty( $a['h'] ) || !empty( $a['w'] ) || !empty( $a['raw_css'] ) ) {
     133      $style = "<style> ";
     134      if ( !empty( $a['h'] ) ) { $style = $style . "#" . $id . " img { height: " . $a['h'] . ";} "; }
     135      if ( !empty( $a['w'] ) ) { $style_wrapper = "style='width: ". $a['w'] . ";'"; }
     136      $style = $style . $a['raw_css'];
     137      $style = $style . " </style>";
     138    }
     139
     140    // Open markup
     141    $before = "<div class='pg-exhibition-wrapper $class' $style_wrapper><section class='pg-exhibition $class' id='$id' tabindex='$counter'>";
     142
     143    // Optional title
     144    if ( !empty($a['title']) ) { $before = $before . "<header>" . $a['title'] . "</header>"; }
     145
     146    // Content
     147    $inside = do_shortcode( strip_tags( $content ) );
     148
     149    // Navigation arrows
     150    $nav = "<a class='gallery-prev' onclick='ScrollInc(-1,\"$id\")'><span>&#10094;</span></a>";
     151    $nav .= "<a class='gallery-next' onclick='ScrollInc(+1,\"$id\")'><span>&#10095;</span></a>";
     152
     153    // Closing markup
     154    $after = $nav."</section></div>";
     155
     156    // Script
     157    $script = "
     158    <script>
     159    var matte = document.getElementById('$id');
     160    document.addEventListener('DOMContentLoaded', function() {
     161      setTimeout(ScrollInc(0, '$id'), 500);
     162    }, false);
     163    matte.addEventListener('wheel', function(event) { jumpScroll(event, '$id'); });
     164    matte.addEventListener('keydown', function(event) {
     165      if(event.key == 'ArrowLeft') ScrollInc(-1, '$id');
     166      if(event.key == 'ArrowRight') ScrollInc(+1, '$id');
     167    });
     168    </script>";
     169
     170    return $style . $before . $inside . $after . $script;
     171  }
     172  add_shortcode( 'exhibition', 'pg_exhibition' );
     173
     174
     175
     176  /*
     177  * Gallery with no caption
     178  */
     179
     180  function pg_no_caption( $atts, $content ){
     181    $before = "<div class='pg-no_caption'>";
     182    $inside = do_shortcode( strip_tags( $content ) );
     183    $after = "</div>";
     184    return $before . $inside . $after;
     185  }
     186  add_shortcode( 'nocaption', 'pg_no_caption' );
     187
     188
     189  /*
     190  * Gallery where pictures are aligned along the bottom side
     191  */
     192
     193  function pg_align_caption( $atts, $content ){
     194    $before = "<div class='pg-align_caption'>";
     195    $inside = do_shortcode( strip_tags( $content ) );
     196    $after = "</div>";
     197    return $before . $inside . $after;
     198  }
     199  add_shortcode( 'aligncaption', 'pg_align_caption' );
     200
     201
     202  /*
     203  * Dynamic gallery based on taxonomy
     204  */
     205
     206  function pg_dynamic_gallery( $atts ){
     207
     208    // Extract the shortcode attributes
     209    $a = shortcode_atts(
     210      array(        // Plugin specific keys
     211        'gallery' => '',
     212        'model' => '',
     213        'location' => '',
     214        'exif' => '',
     215        'author' => '',
     216        'tag' => '',
     217        // Standard WP Query keys
     218        'orderby' => 'date',
     219        'order' => 'ASC',
     220        // Stardard WP gallery shortcode keys
     221        'columns' => '',
     222        'size' => '',
     223        'link' => '',
     224        'type' => '' // for compatibility with Jetpack tiled galleries
     225      ),
     226      $atts );
     227
     228      // Prepare the query
     229      $args = array(
     230        'post_type' => 'attachment',
     231        'post_parent' => 'null',
     232        'post_per_page' => -1,
     233        'author_name' => $a['author'],
     234        'tag' => $a['tag'],
     235        'orderby' => $a['orderby'],
     236        'order' => $a['order'],
     237        'perm'        => 'readable',
     238        'tax_query' => array('relation' => 'AND'),
     239        'post_mime_type'    => array(
     240          'image/jpeg',
     241          'image/jpg',
     242          'image/gif',
     243          'image/png',
     244          'image/bmp'
     245        ),
     246        'fields' => 'ids',
     247      );
     248
     249      // Add the gallery
     250      if ( !empty( $a['gallery'] ) ) {
     251        $gal = array(
     252          'taxonomy' => 'gallery',
     253          'field'    => 'slug',
     254          'terms'    => $a['gallery']
     255        );
     256        array_push( $args['tax_query'] , $gal);
     257      }
     258
     259      // Add the model
     260      if ( !empty( $a['model'] ) ) {
     261        $mod = array(
     262          'taxonomy' => 'model',
     263          'field'    => 'slug',
     264          'terms'    => $a['model']
     265        );
     266        array_push( $args['tax_query'] , $mod);
     267
     268      }
     269
     270      // Add the location
     271      if ( !empty( $a['location'] ) ) {
     272        $loc = array(
     273          'taxonomy' => 'location',
     274          'field'    => 'slug',
     275          'terms'    => $a['location']
     276        );
     277        array_push( $args['tax_query'] , $loc);
     278      }
     279
     280      // The query
     281      $images = get_children( $args );
     282
     283      if ( empty($images) ) {
     284
     285        return __('No image found', 'photographers-galleries');
     286
     287      } else {
     288        // Extract the relevant images IDS
     289        $ids = implode ( ',', array_values( $images ) );
     290
     291        // Build the args array for WP gallery
     292        $args = array(
     293          'ids' => $ids,
     294          'size' => $a['size'],
     295          'columns' => $a['columns'],
     296          'link' => $a['link'],
     297          'type' => $a['type'] // for compatibility with Jetpack themes
     298        );
     299
     300        // Print the standard WP gallery
     301        return gallery_shortcode( $args );
     302      }
     303
     304      // Restore original Post Data
     305      wp_reset_postdata();
     306
     307    }
     308    add_shortcode( 'dynamic_gallery', 'pg_dynamic_gallery' );
  • photographers-galleries/trunk/photographers-galleries.php

    r1405867 r2506644  
    99 * @license   GPL-2.0+
    1010 * @link      https://wordpress.org/plugins/photographers-galleries/
    11  * @copyright 2016 Aurélien Pierre
     11 * @copyright 2016-2021 Aurélien Pierre
    1212 *
    1313 * @wordpress-plugin
     
    1515 * Plugin URI:  https://wordpress.org/plugins/photographers-galleries/
    1616 * Description: Enhance your galleries with HTML5, metadata, dynamic galleries and add a lightweight carousel to display a sequence of pictures without distractions.
    17  * Version:     0.4.2
     17 * Version:     1.0.0
    1818 * Author:      Aurélien PIERRE
    1919 * Author URI:  https://photo.aurelienpierre.com
     
    2828}
    2929
    30 $VERSION = '0.4.2';
    31 
    3230/**
    3331 * Register CSS
    34  * 
     32 *
    3533 * The styles are loaded with a priority of 20  :
    3634 *  * to override the gallery styles of your theme, ensure your theme loads its own stylesheet with a greater priority (> 20),
     
    4038*/
    4139
    42 $PRIORITY = 20;
    43 
     40add_action('wp_enqueue_scripts', 'register_pg_styles', 20 );
    4441function register_pg_styles() {
    45         wp_register_style( 'pg-css', plugins_url( 'photographers-galleries/css/pg-style.css', $VERSION));
    46         wp_enqueue_style( 'pg-css' );
    47 }
    48 add_action( 'wp_enqueue_scripts', 'register_pg_styles', $PRIORITY );
    49 
     42  wp_register_style('pg-css', plugin_dir_url( __FILE__ ).'css/pg-style.min.css', array(), '1.0');
     43  wp_register_script('pg-js', plugin_dir_url( __FILE__ ).'js/pg-script.min.js', array(), '1.0', true);
     44}
     45
     46add_filter('the_content', 'enqueue_photographers_galleries', 100);
     47function enqueue_photographers_galleries( $content )
     48{
     49  // Look for class="gallery" in post and load the CSS only if we have it
     50  if(preg_match('/<(div|section).*class=([\'\"]).*gallery.*\1.*>/s', $content))
     51  {
     52    wp_enqueue_style('pg-css');
     53    wp_enqueue_script('pg-js');
     54  }
     55  return $content;
     56}
    5057
    5158/*
     
    97104include 'admin/media-admin.php';
    98105
     106
     107function remove_post_custom_fields() {
     108    remove_meta_box( 'attachment-compat' , 'attachment' , 'normal' );
     109}
     110add_action( 'admin_menu' , 'remove_post_custom_fields' );
     111
     112function add_media_categories($fields, $post) {
     113    $categories = get_categories(array('taxonomy' => 'model', 'hide_empty' => 0));
     114    $post_categories = wp_get_object_terms($post->ID, 'model', array('fields' => 'ids'));
     115    $all_cats .= '<ul id="media-categories-list" style="width:500px;">';
     116    foreach ($categories as $category) {
     117        if (in_array($category->term_id, $post_categories)) {
     118            $checked = ' checked="checked"';
     119        } else {
     120            $checked = '';
     121        }
     122        $option = '<li style="width:240px;float:left;"><input type="checkbox" value="'.$category->category_nicename.'" id="'.$post->ID.'-'.$category->category_nicename.'" name="'.$post->ID.'-'.$category->category_nicename.'"'.$checked.'> ';
     123        $option .= '<label for="'.$post->ID.'-'.$category->category_nicename.'">'.$category->cat_name.'</label>';
     124        $option .= '</li>';
     125        $all_cats .= $option;
     126    }
     127    $all_cats .= '</ul>';
     128
     129    $categories = array('all_categories' => array (
     130            'label' => __('Models'),
     131            'input' => 'html',
     132            'html' => $all_cats
     133    ));
     134    return array_merge($fields, $categories);
     135}
     136add_filter('attachment_fields_to_edit', 'add_media_categories', null, 2);
     137
     138function add_image_attachment_fields_to_save($post, $attachment) {
     139    $categories = get_categories(array('taxonomy' => 'model', 'hide_empty' => 0));
     140    $terms = array();
     141    foreach($categories as $category) {
     142        if (isset($_POST[$post['ID'].'-'.$category->category_nicename])) {
     143            $terms[] = $_POST[$post['ID'].'-'.$category->category_nicename];
     144        }
     145    }
     146    wp_set_object_terms( $post['ID'], $terms, 'model' );
     147    return $post;
     148}
     149add_filter('attachment_fields_to_save', 'add_image_attachment_fields_to_save', null , 2);
     150
     151add_action( 'after_setup_theme', 'pg_custom_add_image_sizes' );
     152function pg_custom_add_image_sizes() {
     153
     154  /*
     155  https://www.w3counter.com/globalstats.php
     156  repartition :
     157  1     1366x768    10.09%
     158  2     640x360     9.43%
     159  3     1920x1080   7.32%
     160  4     667x375     5.06%
     161  5     896x414     4.44%
     162  6     1024x768    4.00%
     163  7     812x375     3.54%
     164  8     780x360     3.26%
     165  9     760x360     2.93%
     166  10    1440x900    2.90%
     167  */
     168
     169  add_image_size( 'portrait-7680', '7680', '0', false ); // 8K
     170  add_image_size( 'portrait-4096', '4096', '0', false ); // 4K cinema
     171  add_image_size( 'portrait-3840', '3840', '0', false ); // 4K
     172  add_image_size( 'portrait-2560', '2560', '0', false ); // QHD / WQHD
     173  add_image_size( 'portrait-2048', '2048', '0', false ); // 2K
     174  add_image_size( 'portrait-1920', '1920', '0', false ); // Full HD
     175  add_image_size( 'portrait-1680', '1680', '0', false ); // Desktop WSXGA+
     176  add_image_size( 'portrait-1440', '1440', '0', false ); // Desktop WXGA+
     177  add_image_size( 'portrait-1366', '1366', '0', false ); // HD-ish
     178  add_image_size( 'portrait-1280', '1280', '0', false ); // WXGA - HD
     179  add_image_size( 'portrait-1080', '1080', '0', false ); // Full HD height
     180  add_image_size( 'portrait-960', '960', '0', false );   // DVGA - iPhone 4
     181  add_image_size( 'portrait-800', '800', '0', false );   // WXGA - HD height
     182  add_image_size( 'portrait-640', '640', '0', false );   // VGA - Standard definition
     183  add_image_size( 'portrait-480', '480', '0', false );   // HVGA - Palm, iPhone 1
     184  add_image_size( 'portrait-360', '360', '0', false );   // Old stuff
     185  add_image_size( 'portrait-240', '240', '0', false );   // Very old stuff
     186
     187  // panoramic images
     188  add_image_size( 'landscape-7680', '0', '7680', false ); // 8K
     189  add_image_size( 'landscape-4096', '0', '4096', false ); // 4K cinema
     190  add_image_size( 'landscape-3840', '0', '3840', false ); // 4K
     191  add_image_size( 'landscape-2560', '0', '2560', false ); // QHD / WQHD
     192  add_image_size( 'landscape-2048', '0', '2048', false ); // 2K
     193  add_image_size( 'landscape-1920', '0', '1920', false ); // Full HD
     194  add_image_size( 'landscape-1680', '0', '1680', false ); // Desktop WSXGA+
     195  add_image_size( 'landscape-1440', '0', '1440', false ); // Desktop WXGA+
     196  add_image_size( 'landscape-1366', '0', '1366', false ); // HD-ish
     197  add_image_size( 'landscape-1280', '0', '1280', false ); // WXGA - HD
     198  add_image_size( 'landscape-1080', '0', '1080', false ); // Full HD height
     199  add_image_size( 'landscape-960', '0', '960', false );   // DVGA - iPhone 4
     200  add_image_size( 'landscape-800', '0', '800', false );   // WXGA - HD height
     201  add_image_size( 'landscape-640', '0', '640', false );   // VGA - Standard definition
     202  add_image_size( 'landscape-480', '0', '480', false );   // HVGA - Palm, iPhone 1
     203  add_image_size( 'landscape-360', '0', '360', false );   // Old stuff
     204  add_image_size( 'landscape-240', '0', '240', false );   // Very old stuff
     205}
  • photographers-galleries/trunk/readme.txt

    r1405167 r2506644  
    44Tags: gallery, html5, carousel, pictures, responsive, jetpack, photo, taxonomy, exif
    55Requires at least: 3.6
    6 Tested up to: 4.5
     6Tested up to: 5.7
    77Stable tag: trunk
    88License: GPLv2 or later
    99License URI: http://www.gnu.org/licenses/gpl-2.0.html
    1010
    11 Enhance your galleries with HTML5 and add a lightweight CSS3 carousel to display a sequence of pictures without distractions.
     11Enhance your galleries with HTML5 and add a lightweight CSS3 carousel to display a sequence of pictures without distraction.
    1212
    1313== Description ==
    1414
    15 *Most gallery plugins are made for pictures. This one is made for photographers by a photographer.*
    16 
    17 **Photographers** usualy need to show their pictures without adding distracting effects such as transitions, frames, shadows, autoplay etc. They are cool though, but visitors may want to look at the pics, not at the fanciness of the latest top-notch trendy slider plugin which might, by the way, slow down their mobile device.
    18 
    19 Native WordPress galleries are a bit too basic to achieve this but in the other hand, galleries plugins are often too heavy and overcomplicated. Photo websites are heavy enough because of the pictures, it's a good idea to keep them as light as possible.
    20 
    21 **Photographers galleries** helps photographers to organize their media library and to display dynamic galleries. It is built
    22 with the needs of professional photographers in mind, with the use paradigms you already find in Flickr or 500px.
    23 
    24 It shows nothing but the pictures, with a clean minimalist and responsive design that will fit flawless in most themes,
    25 trying to reproduce the user experience you could get at a museum exhibition or in a fashion magazine.
    26 To stay lightweight and compatible with every modern browser (mobile and desktop), it only takes advantage of native
    27 Wordpress 3.6+, HTML5, PHP and CSS3 capabilities. No additional javascript is required. The styling is consistent with Jetpack galleries.
     15Most fancy gallery plugins will add their gallery manager on top of WordPress, which already has one… Then, they will crop images to fit within their fancy layout.
     16Unfortunately, if you are an artist, the way you composed and framed your picture is no accident and should be honored by whatever display system you use.
     17After all that, they will add an awful bloat of jQuery madness that will put a hole in your [Page Speed](https://developers.google.com/speed/pagespeed/insights/) score
     18and kill your [loading time](https://tools.pingdom.com/). Finally, they will distract visitors from your content with all their fancy effects that make your CPU overheat for nothing.
     19
     20We need better.
     21
     22Photographers galleries extends native WordPress galleries with EXIF support and taxonomies, and uses native browser technologies (CSS and HTML), with only a bit of native Javascript to extend them (no additional lib, no jQuery dependency).
     23This ensures fast loading, fast execution, and will take advantage of hardware-accelerated animations, which happen to be more energy-efficient.
     24It also loads minified CSS and Javascript, only on the pages that actually make use of galleries. It's fast, minimalist, simple, robust, and good for your SEO (which is now a factor in [Google Page Rank](https://tools.pingdom.com/)).
     25
     26The look is inspired by art books and museums exhibitions, meant to allow a flawless and non-intrusive full-screen experience, so you can design your website as a webapp.
    2827
    2928[Demo](https://photo.aurelienpierre.com/photographers-galleries-demo/)
    3029
    31 = Quick features overview =
    32 
    33 * Lightweight and robust : no javascript, it uses browsers, CSS3, HTML5 and WordPress native features,
     30= Quick features overview =
     31
    3432* Ready to use with caching, minification and lazy loading plugins : WP Super Cache, W3 Total Cache, WP Rocket, etc.,
    3533* Compatible with Jetpack tiled galleries and every lightbox plugin, consistent with Jetpack tiled galleries styling,
    3634* Fully responsive (width and height),
     35* The JS weighs only 4.7 kB, and the CSS 7 kB. JS is loaded in page footer and supports deferring.
    3736* Theme-agnostic design, classy minimalist look.
    3837
    39 = Attachements improvements = 
     38= Attachements improvements =
    4039
    4140**Photographers galleries** enhances the WordPress attachments from the media library by enabling regular posts properties on them :
     
    5352* models (**who** is on the picture).
    5453
    55 These taxonomies are hierarchical, meaning that a "USA" parent location can have "Texas" and "Nevada" children locations which can have children themselves. 
     54These taxonomies are hierarchical, meaning that a "USA" parent location can have "Texas" and "Nevada" children locations which can have children themselves.
    5655
    5756Taxonomies and tags make the attachments queryable in archives, just like posts categories, so they allow you to display dynamic galleries either through custom
     
    6059multiple galleries in one step, during its upload in a post editor or in the media library.
    6160
    62 To add taxonomies terms to your pictures during their upload in posts editor, use the plugin [Media Library Assistant](https://wordpress.org/plugins/media-library-assistant/). 
     61To add taxonomies terms to your pictures during their upload in posts editor, use the plugin [Media Library Assistant](https://wordpress.org/plugins/media-library-assistant/).
    6362It will help you to bulk edit your media library too. See [Other notes](https://wordpress.org/plugins/photographers-galleries/other_notes/) to find how to set MLA.
    6463
    6564= Galleries improvements =
    6665
    67 **Photographers galleries** enable the WordPress built-in HTML5 support for pictures and galleries to produce `<figure>` and `<figcaption>` tags to increase
    68 the SEO and get rid of WordPress default gallery layout (which width is set by the global variable `$content_width`) and adds a fully responsive
    69 stylesheet to fit the galleries along the borders of the container.
     66**Photographers galleries** enable the WordPress built-in HTML5 support for pictures and galleries to produce `<figure>` and `<figcaption>` tags to increase
     67the SEO and get rid of WordPress default gallery layout (which width is set by the global variable `$content_width`). They add a fully responsive
     68stylesheet to fit the galleries along the borders of the container.
     69
     70It also adds more thumbnails sizes for the responsive `srcset` HTML attribute of images, allowing browsers to load exactly the right image size for the current viewport size.
     71These sizes go all the way from 240×360px to 4096×2160px, so don't be afraid to upload high-resolution images, your visitors will only see the image size relevant for their screen size and pixel density.
    7072
    7173No particular operation is required, just use your regular WordPress gallery builder inside the post editor.
     
    7375= Extra layouts & shortcodes wrappers for WordPress galleries =
    7476
    75 **Photographers galleries** uses only regular WordPress galleries, called by the `[gallery]` shortcode, and does not rewrite them. 
     77**Photographers galleries** uses only regular WordPress galleries, called by the `[gallery]` shortcode, and does not rewrite them.
    7678This is intended to ensure maximum compatibility with other plugins (lightboxes, etc.) as well at with future WordPress versions. The extra gallery layouts are
    7779provided by extra shortcodes to wrap around the WordPress galleries.
    7880
     81**Note : this makes use of the classic editor gallery, not the Gutenberg block. For what Photographers galleries does, the Gutenberg gallery block adds no benefit over the classic gallery.**
     82
    7983Extra gallery layouts :
    8084
     
    8690= Carousel =
    8791
    88 **Photographers galleries** has a fixed-height carousel which takes by default 100 % of the container width and 92 % of the viewport height
    89 (99 % if captions are not displayed). It uses the native scollbars of the browser to ensure compatibility with every device, mobile or desktop.
    90 
    91 The pictures are fitted to the same height so the layout is flawless and continuous, perfect to display a serie
     92**Photographers galleries** has a fixed-height carousel which takes by default 100 % of the container width and 92 % of the viewport height
     93(99 % if captions are not displayed). It uses the native browser scrolling, supporting horizontal scrolling (touchpad and mouse wheel),
     94swiping gestures (touch screens), click/tap on the next/previous buttons, as well as keyboard arrow keys (left and right).
     95
     96The pictures are fitted to the same height so the layout is flawless and continuous, perfect to display a serie
    9297or a portfolio. Every carousel instance on a same page can have its own style. This carousel was inspired by [Format](https://format.com/themes#horizon).
    9398
    9499See [Installation](https://wordpress.org/plugins/photographers-galleries/installation/) tab for use details.
    95100
     101= Exhibitions =
     102
     103Exhibitions are a new mode of the 1.0 that enables a full-width and full-height experience with a framing look reproducing museum framings.
     104They come in-place of usual lightboxes and gives your pictures maximal impact with minimal clutter, assuming you will use them in a full-width theme template.
     105They support keyboard arrow keys interactions, as well as horizontal scrolling and click/tap on the buttons.
     106
    96107= Media library improvements =
    97108
     
    99110
    100111* time and date of the capture,
    101 * camera, 
    102 * focal length, 
     112* camera,
     113* focal length,
    103114* ISO,
    104115* aperture,
     
    107118* author credit.
    108119
    109 = Upcoming features =
    110 
    111 We are in dev phase so kep in touch. If you are a dev, you are welcome to contribute !
    112 
    113 1. A theme template part for attachments taxonomies archives,
    114 1. A bulk edit option to add multiple images in batch to attachments taxonomies (thus galleries),
    115 1. A hook to add taxonomies directly in the post editor (while uploading them) without Media Library Assistant (overkill) plugin,
    116 1. Workarounds with Exifography plugin to build dynamic galleries based on Exif metadata (shot date, ISO, aperture, camera, GPS, etc.).
    117 
    118 = Coding philosophy =
    119 
    120 **1. Never overwrite WordPress core functions** : that's nasty and garanteed to break other plugins now or in the future.
    121 Moreover, as soon as these WP functions will be rewritten, our code would be obsolete. You would be suprised to know how many
    122 plugins overwrite the native `[gallery]` shortcode, for example. That's bad.
    123 All we do is building around WP core with wrappers, passing to them the right inputs and getting the right outputs.
    124 
    125 **2. Separating the form and the content** : that means that you will always be able to use your own style over PG's one while
    126 using it without nasty tricks (usefull for theme developpers). We will use filters as much as possible so themes developpers
    127 could modify them on the fly.
    128 
    129 **3. Never have a settings page*** : we will always add options on standard WP admin pages so you should never have to mess up
    130 with complex settings. The paradigm choosen is very similar to the 500 px or Flickr one, keeping in mind the professional photographer needs.
    131 So let's stuck to something you already know : WP default interface.
    132 
    133 **4. Build on top of WordPress** : my secret wish is to get this functions natively into WordPress core so we will keep it
    134 modular.
    135 
    136 **5. Every part of the code is commented with docstrings** : because I code for others.
     120== Caveats ==
     121
     122Using native WordPress galleries, Photographers Galleries need to overwrite theme styling, which might still compete with it.
     123Some CSS tuning might be necessary
    137124
    138125== Installation ==
    139126
    1401271. Upload the plugin files to the `/wp-content/plugins/plugin-name` directory, or install the plugin through the WordPress plugins screen directly.
    141 1. Activate the plugin through the 'Plugins' screen in WordPress
     1281. Activate the plugin through the 'Plugins' screen in WordPress.
    142129
    143130The plugin has no configuration page.
     
    145132= Dynamic gallery =
    146133
    147 This shortcode fetches all the pictures from a taxonomy (galleries, models, locations, tags) to build a dynamic gallery 
     134This shortcode fetches all the pictures from a taxonomy (galleries, models, locations, tags) to build a dynamic gallery
    148135(which will be updated as soon as you add a picture to the corresponding taxonomy). All the display is processed by the regular
    149136WordPress shortcode, we just give it the pictures to show (meaning that your default styles, Jetpack, lightboxes etc. will work).
     
    159146**Arguments** :
    160147
    161 * DISPLAY ARGUMENTS *optionnal*
     148* DISPLAY ARGUMENTS *optional*
    162149    * Standard WordPress gallery arguments (See [the WP Codex](http://codex.wordpress.org/Gallery_Shortcode)):
    163150        * `columns`
     
    166153    * Jetpack argument (See [the Jetpack Support](https://en.support.wordpress.com/gallery/#adding-a-gallery-or-slideshow)) :
    167154        * `type`
    168 * CONTENT ARGUMENTS 
     155* CONTENT ARGUMENTS
    169156    * Photographers galleries arguments : *they are all optional but you have to set at least one of them*
    170157        * `gallery` : the term (slug) of the gallery whose pictures you want to show
     
    175162        * `exif` : not yet implemented
    176163    * Standard WordPress query arguments (See [the WP Codex](https://codex.wordpress.org/Class_Reference/WP_Query#Order_.26_Orderby_Parameters)) :
    177         * `order` : *default : ASC* 
     164        * `order` : *default : ASC*
    178165        * `orderby` : *default : date*
    179166        * For these two arguments, you can directly pass any of the allowed values described in the `WP_Query` documentation.
    180    
     167
    181168Note that if you give more than one condition, the conditions are added with `AND`. There is no way to exlude pictures for now.
    182169
    183170= Galleries aligned by their caption =
    184171
    185 By default, pictures of different heights are aligned along their top border. To align them along their bottom border 
    186 (meaning to have all the captions on the same line), use the `[aligncaption]` shortcode like this : `[aligncaption][gallery ids=""][/aligncaption]`. 
    187 Please be aware that other galleries types may be more suitable if you have different heights on the same gallery (e.g. tiled or masonry galleries), 
     172By default, pictures of different heights are aligned along their top border. To align them along their bottom border
     173(meaning to have all the captions on the same line), use the `[aligncaption]` shortcode like this : `[aligncaption][gallery ids=""][/aligncaption]`.
     174Please be aware that other galleries types may be more suitable if you have different heights on the same gallery (e.g. tiled or masonry galleries),
    188175this is just a quick hook to improve captions readability.
    189176
     
    196183= Carousel =
    197184
    198 Just put your regular gallery shortcode in `[carousel]` shortcode like this : `[carousel][gallery ids=""][/carousel]`
     185Just put your regular gallery shortcode in `[carousel]` shortcode like this : `[carousel][gallery ids="" size="full"][/carousel]`
    199186
    200187Ensure your picture resolution is high enough to fit modern screens without stretching (2048 px on the large side is recommended).
     
    229216    * `center`
    230217* `raw_css` = raw CSS code — default : `none`
    231     * provide an easy way to quickly add custom CSS to a container 
    232     * if you want to style only one specific carousel, use the id `pg-carousel-X` where `X` is the order of your carousel on your page (from 1) 
     218    * provide an easy way to quickly add custom CSS to a container
     219    * if you want to style only one specific carousel, use the id `pg-carousel-X` where `X` is the order of your carousel on your page (from 1)
    233220
    234221Please notice that the height argument sets the actual image height, not the whole carousel height, so don't forget to leave some room for the captions (0.9em + 2ex) and the scrolling bar (around 20px).
     
    236223Each carousel on the page gets its own ID and settings, meaning that you can use several carousels on the same page with various settings.
    237224
     225= Exhibitions =
     226
     227They work very similarly to carousels : `[exhibition][gallery ids="" size="full"][/exhibition]`.
     228
     229**Arguments** :
     230
     231All the same as carousels, plus a `look` argument to choose the styling :
     232
     233* `modern` : similar to an alu-dibond mounting,
     234* `classic` : similar to a classical framing with a passe-partout,
     235* `box`, `box-dark`, `box-bright` : similar to a shadow box (called American box in Europe), in 3 shades,
     236* `plain` : no styling at all,
     237* `custom`, etc : you can create your own CSS looks by setting `look="your-name"` in the shortcode, and style the CSS selector `.pg-exhibition-wrapper .look-your-name`.
     238
    238239== Other notes ==
    239240
    240 = Configuring Media Library Assistant for PG = 
     241= Configuring Media Library Assistant for PG =
    241242
    2422431. Go to "General tab"
     
    251252
    252253== Changelog ==
     254
     255= 1.0 =
     256
     257* Fix Safari issues with picture height in carousels
     258* Add keyboard, touch swipe and horizontal scroll support in carousels
     259* Add exhibition mode
     260* Add thumbnail sizes for common screen resolutions, to fit in `scrset` of responsive images
    253261
    254262= 0.4 =
     
    263271Minor default style tweaks
    264272
    265 = 0.3 = 
     273= 0.3 =
    266274Add custom taxonomies, tags, comments and categories to attachments
    267275
     
    271279= 0.1 =
    272280Initial version
    273 
Note: See TracChangeset for help on using the changeset viewer.