Compare commits

..

10 Commits

Author SHA1 Message Date
35086dbd0a Reinstall silverbook 2019-08-17 16:50:01 +02:00
b46d52b8c3 Update french language 2019-03-15 20:22:04 +01:00
6bafec7e53 clean up code 2019-01-15 08:25:23 +01:00
19db9130ee Minor changes 2019-01-15 07:04:22 +01:00
c1fb81ddaa Edit post
- post-meta.php: ajout de la condition if (current_user_can( 'edit_post' ))
2019-01-11 07:01:53 +01:00
6662ab3a62 Editer single-post
-post-meta.php
2019-01-10 20:25:27 +01:00
b4af1c2afd Post navigation
article suivant / articje précédent
2019-01-10 11:05:40 +01:00
4d9b34861c Pagination
-ajout pagination sur page Ce-mois-ci
2019-01-06 17:13:33 +01:00
904e6ac59b Tags
-recherche des tags de l’image du mois (PDO)
-affichage des tags sous l’image, avec liens vers Zenphoto
2019-01-06 11:06:25 +01:00
8b6452fa28 Vignette thumb not found 2019-01-06 07:17:17 +01:00
8 changed files with 577 additions and 200 deletions

View File

@@ -0,0 +1,20 @@
<!--start meta -->
<div class="blog-meta">
<span><i class="kk kk-icon-pencil"></i><?php the_author(); ?></span>
/
<span><i class="kk kk-icon-folder-open-empty"></i><?php the_category(', '); ?></span>
/
<span><i class="kk kk-icon-clock"></i><time><?php the_date(); ?></time></span>
/
<span><a title="<?php printf(__('View comments to %s', 'toppic'), get_the_title()); ?>" href="<?php comments_link(); ?> "><i class="kk kk-icon-comment-empty"></i><?php comments_number(__('0 Comments', 'toppic'), __('1 Comment', 'toppic'), __('% Comments', 'toppic'))?></a></span>
<?php if (function_exists('printLikes')) { ?>
/
<span> <?php printLikes(get_the_ID()); ?> </span>
<?php } ?>
<?php if (current_user_can( 'edit_post' )) { ?>
/
<span> <?php edit_post_link(); ?> <span>
<?php } ?>
</div>
<!--end meta -->

View File

@@ -26,10 +26,92 @@ function kkHideUpdateNotice() {
/* WRITE YOUR OWN FUNCTIONS BELOW
/*-----------------------------------------------------------------------------------*/
/*
<link rel='stylesheet' id='kk-lightbox-css' href='http://silverbook.local/wordpress/wp-content/themes/toppic/css/lightbox.css?ver=2.7' type='text/css' media='all' />
<script type='text/javascript' src='http://silverbook.local/wordpress/wp-content/themes/toppic/js/jquery.lightbox.js?ver=2.7'></script>
wp_enqueue_style( 'kk-lightbox', get_theme_file_uri( '/css/lightbox.css' ), '', KKFW_VERSION );
if(get_post_meta($postid, '_gallery_layout_value', true) !== 'Fullscreen' && !is_page_template('template-homepage.php')) {
wp_enqueue_script('kk-lightbox', get_theme_file_uri( '/js/jquery.lightbox.js' ), array( 'jquery' ), KKFW_VERSION, true);
head:
<link href="../dist/css/lightgallery.css" rel="stylesheet">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.2/jquery.min.js"></script>
corps à la fin:
<script type="text/javascript">
$(document).ready(function(){
$('#lightgallery').lightGallery();
});
</script>
<script src="https://cdn.jsdelivr.net/picturefill/2.3.1/picturefill.min.js"></script>
<script src="../dist/js/lightgallery-all.min.js"></script>
<script src="../lib/jquery.mousewheel.min.js"></script>
function google_jquery() {
if (!is_admin()) {
wp_deregister_script('jquery');
wp_register_script('jquery', 'http://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js', false, '3.3.1');
//wp_register_script('jquery', get_stylesheet_directory_uri() . '/js/jquery.min.js', false, '3.3.1');
wp_enqueue_script('jquery');
}
}
add_action('init', 'google_jquery');
*/
/*function deregister_kklightbox() {
if ( is_page_template( 'page-ce-mois-ci.php' ) ) {
wp_deregister_script('kk-lightbox');
//wp_register_script('jquery', 'http://ajax.googleapis.com/ajax/libs/jquery/3.1.1/jquery.min.js', false, '3.1.1');
//wp_register_script('jquery', get_stylesheet_directory_uri() . '/js/jquery.min.js', false, '3.3.1');
//wp_enqueue_script('jquery');
wp_deregister_style('kk-lightbox-css');
}
}
add_action('init', 'deregister_kklightbox');
function register_lightGallery() {
if ( is_page_template( 'page-ce-mois-ci.php' ) ) {
// head
wp_enqueue_style( 'lightGallery', get_stylesheet_directory_uri() . '/lightGallery/dist/css/lightgallery.min.css' );
// jquery
// fin
wp_enqueue_script('lightGallery', get_theme_file_uri( '/lightGallery/lib/picturefill.min.js' ), array( 'jquery' ), KKFW_VERSION, true);
wp_enqueue_script('lightGallery', get_theme_file_uri( '/lightGallery/dist/js/lightgallery-all.min.js' ), array( 'jquery' ), KKFW_VERSION, true);
wp_enqueue_script('lightGallery', get_theme_file_uri( '/lightGallery/lib/jquery.mousewheel.min.js' ), array( 'jquery' ), KKFW_VERSION, true);
}
}
add_action( 'wp_enqueue_scripts', 'register_lightGallery' );
*/
/* Returns the name of one random file from within a directory
livre-d-or.php:39:
*/
function register_photoSwipe() {
if ( is_page_template( 'page-ce-mois-ci.php' ) ) {
// head
wp_enqueue_style( 'photoSwipe', get_stylesheet_directory_uri() . '/photoSwipe/photoswipe.css' );
// jquery
// fin
wp_enqueue_style('photoSwipe', get_theme_file_uri( '/photoSwipe/default-skin/default-skin.css' ), array( 'jquery' ), KKFW_VERSION, true);
wp_enqueue_script('photoSwipe', get_theme_file_uri( '/photoSwipe/photoswipe.min.js' ), array( 'jquery' ), KKFW_VERSION, true);
wp_enqueue_script('photoSwipe', get_theme_file_uri( '/photoSwipe/photoswipe-ui-default.min.js' ), array( 'jquery' ), KKFW_VERSION, true);
}
}
//add_action( 'wp_enqueue_scripts', 'register_photoSwipe' );
function getRandomFile($start_dir) {
chdir($start_dir);
@@ -212,9 +294,6 @@ function imagesFromZPAlbum ($album, $connexion) {
/*
Ajouter: EXIFLensInfo
Array
(
[0] => Array
@@ -226,6 +305,7 @@ function imagesFromZPAlbum ($album, $connexion) {
[EXIFFNumber] => f/7,1
[EXIFISOSpeedRatings] => 500
[EXIFFocalLength] => 700 mm
[EXIFLensInfo] => EF500mm f/4L IS USM
[EXIFGPSLatitude] =>
[EXIFGPSLatitudeRef] =>
[EXIFGPSLongitude] =>
@@ -244,6 +324,68 @@ function imagesFromZPAlbum ($album, $connexion) {
return $fichier;
}
function ZPGetTag ($filename, $album, $connexion) {
$table = array();
$table['images'] = $connexion['zp_prefix'] . "images";
$table['albums'] = $connexion['zp_prefix'] . "albums";
$table['obj_to_tag'] = $connexion['zp_prefix'] . "obj_to_tag";
$table['tags'] = $connexion['zp_prefix'] . "tags";
$charset = 'utf8';
$host = $connexion['host'];
$dbname = $connexion['db_zenphoto'];
$dsn = "mysql:host=$host;dbname=$dbname;charset=$charset";
$options = [
PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION,
PDO::ATTR_DEFAULT_FETCH_MODE => PDO::FETCH_ASSOC,
PDO::ATTR_EMULATE_PREPARES => false,
];
try {
$pdo = new PDO($dsn, $connexion['user'], $connexion['password'], $options);
} catch (\PDOException $e) {
throw new \PDOException($e->getMessage(), (int)$e->getCode());
}
// 1. id de l'image:
$query1 = "SELECT `id` FROM `" . $table['images'] . "` WHERE `filename` = ?";
$stmt = $pdo->prepare($query1);
$stmt->execute([$filename]);
//$fichier = $stmt->fetchAll(PDO::FETCH_ASSOC);
while ($row = $stmt->fetch()) {
//echo $row['id'] . "\n";
$id_image = $row['id'];
}
// 2. ids des tags de l'image:
$query2 = "SELECT `tagid` FROM `" . $table['obj_to_tag'] . "` WHERE `objectid` = ?";
$stmt = $pdo->prepare($query2);
$stmt->execute([$id_image]);
//$ids_tag = $stmt->fetchAll(PDO::FETCH_COLUMN);
while ($ids_tag = $stmt->fetch()) {
$query_tags .= " `id` = " . $ids_tag['tagid'] . " OR ";
}
// 3. Liste des tags correspondant aux ids:
$query_tags = substr($query_tags, 0, -4);;
$query3 = "SELECT `name` FROM `_tags` WHERE $query_tags";
$stmt = $pdo->prepare($query3);
$stmt->execute();
$tags = $stmt->fetchAll(PDO::FETCH_COLUMN);
return $tags;
}
/*
page-ce-mois-ci.php
*/
@@ -251,8 +393,6 @@ function displayRetina ($file,$album) {
global $ppage;
echo "<b>$ppage</b>";
//preprint($file);
/*
@@ -277,33 +417,30 @@ function displayRetina ($file,$album) {
)
*/
if ($ppage == "1") {
$fullpath = "../../zenphoto/";
}
else {
$fullpath = "../../../zenphoto/";
}
if ($ppage == "1") $fullpath = "../../zenphoto/";
else $fullpath = "../../../zenphoto/";
$thumbsize = 200;
$watermark = "thumb";
$name = explode(".", $file['filename']);
$thumbpath = "../zenphoto/cache/" . $album . "/";
//$a = $path . $filename;
$file_sd = $thumbpath . $name[0] . "_200_thumb.jpg";
$file_hd = $thumbpath . $name[0] . "_400_thumb.jpg";
//echo $file_sd;
//echo $file_hd;
/*
$file_sd = $path . $file[0] . "_180_watermark.jpg";
$file_hd = $path . $file[0] . "_360_watermark.jpg";
*/
$file_sd = $thumbpath . $name[0] . "_" . $thumbsize . "_" . $watermark .".jpg";
$file_hd = $thumbpath . $name[0] . "_" . ($thumbsize * 2) . "_" . $watermark .".jpg";
$th_sd = false;
$th_hd = false;
$thumb = array();
if (file_exists($file_hd)) {
$th_hd = true;
$size_hd = getimagesize($file_hd, $info);
$thumb['hd'] = array(
'url' => "../../" . $file_hd,
'width' => $size_hd[0],
'height' => $size_hd[1]
);
}
if (file_exists($file_sd)) {
$th_sd = true;
$size_sd = getimagesize($file_sd, $info);
@@ -313,13 +450,13 @@ function displayRetina ($file,$album) {
'height' => $size_sd[1]
);
}
if (file_exists($file_hd)) {
$th_hd = true;
$size_hd = getimagesize($file_hd, $info);
$thumb['hd'] = array(
'url' => "../../" . $file_hd,
'width' => $size_hd[0],
'height' => $size_hd[1]
if (($th_sd == false) || ($th_hd == false)) {
$notfound = "../zenphoto/zp-core/images/err-imagenotfound.png";
$size_sd = getimagesize($notfound, $info);
$thumb['sd'] = array(
'url' => "../../" . $notfound,
'width' => $size_sd[0],
'height' => $size_sd[1]
);
}
@@ -333,32 +470,12 @@ function displayRetina ($file,$album) {
$standard = $thumb['hd']['url'] . ' 400w';
}
//print_r($standard);
$display = '<div class="album">';
$display .= '<div class="holder">';
$display .= '<a href="' . $fullpath . 'albums/'.$album.'/'.$file['filename'].'" title="'.date_archive($file['filename']).'" class="kk-lightbox">';
/*
$display .= '<picture data-picture data-alt="">';
$display .= '<!--[if IE 9]><video style="display: none;"><![endif]-->';
$display .= '<source class="image_standard" srcset="' . $standard . '">';
$display .= '<!--[if IE 9]></video><![endif]-->';
$display .= '<img srcset="' . $thumb['sd']['url'] . '" width="' . $thumb['sd']['width'] . '" height="' . $thumb['sd']['height'] . '"alt="">';
$display .= '</picture>';
$display .= '<img width="" height=""
src="../../../zenphoto/cache/photos-du-mois/10_2016_200_thumb.jpg"
class="" alt=""
srcset="../../../zenphoto/cache/photos-du-mois/10_2016_200_thumb.jpg 200w,
../../../zenphoto/cache/photos-du-mois/10_2016_400_thumb.jpg 400w"
sizes="(max-width: 200px) 100vw, 200px" />';
$display .= '<img width="' . $thumb['sd']['width'] . '" height="' . $thumb['sd']['height'] . '"
src="' . $thumb['sd']['url'] . '"
class="" alt=""
srcset="' . $standard . '"
sizes="(max-width: 200px) 100vw, 200px" />';
*/
$display .= "<img width='" . $thumb['sd']['width'] . "' height='" . $thumb['sd']['height'] . "' src='" . $thumb['sd']['url'] . "' class='' alt='' srcset='" . $standard . "' sizes='(max-width: 200px) 100vw, 200px' />";
$display .= '</a>';
@@ -369,12 +486,59 @@ function displayRetina ($file,$album) {
$display .= '</a></div>';
$display .= '</div>' . "\r\n";
//echo "display: " . $display;
return $display;
}
/* SHORTCODE: Images sur Zenphoto */
function zenphoto_handler($atts) {
//utilise le cacheManager de zenphoto (extensions/utilitaires/cacheManager)
// ** Utilisation **
// [zenphoto album="lievres" image="2008-08-18_Lievre_8927.jpg"]
// [zenphoto album="sports-mecaniques/gp-france" image="2010-05-23_gp-france-2010_5321.jpg"]
// [zenphoto album="lievres"]
//
//taille des photos dans Worpress, theme Twenty Ten Child : 610x406
/*
$selector = dess_setting('dess_lightbox_select');
$zenphoto_url = dess_setting('dess_zenphoto');
$size = dess_setting('dess_zp_size');
*/
preprint($atts);
//require_once($_SERVER['DOCUMENT_ROOT'].'/Connections/cnx.php');
$selector = "meow-lightbox";
//$zenphoto_url = "https://silverbook.local/zenphoto/";
$zenphoto_url = "https://" . $_SERVER["SERVER_NAME"] . "/zenphoto/";
$size = 800;
$album = ! empty( $atts['album'] ) ? $atts['album'] : '';
$album = filter_var($album, FILTER_SANITIZE_STRING);
$image = ! empty( $atts['image'] ) ? $atts['image'] : '';
$image = filter_var($image, FILTER_SANITIZE_STRING);
$caption = ! empty( $atts['caption'] ) ? $atts['caption'] : '';
$caption = filter_var($caption, FILTER_SANITIZE_STRING);
$rnd = rand (1000, 9999);
//$size = 610;
$folder = false;
$zenphoto_img = "";
return $zenphoto_img;
}
add_shortcode( 'zenphoto', 'zenphoto_handler' );
/*
*functions.php - displayRetina() displayRetina()

Binary file not shown.

View File

@@ -1,112 +1,149 @@
msgid ""
msgstr ""
"Plural-Forms: nplurals=2; plural=(n > 1);\n"
"Project-Id-Version: TopPic Child\n"
"POT-Creation-Date: 2019-01-04 22:25+0100\n"
"PO-Revision-Date: 2019-01-04 22:48+0100\n"
"POT-Creation-Date: 2019-01-16 15:49+0100\n"
"PO-Revision-Date: 2019-01-16 15:52+0100\n"
"Last-Translator: Pesenti <bruno@cliccclac.info>\n"
"Language-Team: Pesenti <bruno@cliccclac.info>\n"
"Language: fr_FR\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Generator: Poedit 2.2\n"
"X-Poedit-Basepath: ../..\n"
"Plural-Forms: nplurals=2; plural=(n > 1);\n"
"X-Generator: Poedit 2.2.1\n"
"X-Poedit-Basepath: ..\n"
"X-Poedit-Flags-xgettext: --add-comments=translators:\n"
"X-Poedit-WPHeader: style.css\n"
"X-Poedit-SourceCharset: UTF-8\n"
"X-Poedit-KeywordsList: __;_e;_n:1,2;_x:1,2c;_ex:1,2c;_nx:4c,1,2;esc_attr__;esc_attr_e;esc_attr_x:1,2c;esc_html__;esc_html_e;esc_html_x:1,2c;_n_noop:1,2;_nx_noop:3c,1,2;__ngettext_noop:1,2\n"
"Last-Translator: Pesenti <bruno@cliccclac.info>\n"
"Language: fr_FR\n"
"X-Poedit-KeywordsList: __;_e;_n:1,2;_x:1,2c;_ex:1,2c;_nx:4c,1,2;esc_attr__;"
"esc_attr_e;esc_attr_x:1,2c;esc_html__;esc_html_e;esc_html_x:1,2c;"
"_n_noop:1,2;_nx_noop:3c,1,2;__ngettext_noop:1,2\n"
"X-Poedit-SearchPath-0: .\n"
"X-Poedit-SearchPathExcluded-0: *.js\n"
#: functions.php:75
#: formats/single-post/post-meta.php:9
#, php-format
msgid "View comments to %s"
msgstr "Voir les commentaires de %s"
#: formats/single-post/post-meta.php:9
msgid "0 Comments"
msgstr "0 Commentaire"
#: formats/single-post/post-meta.php:9
msgid "1 Comment"
msgstr "1 Commentaire"
#: formats/single-post/post-meta.php:9
msgid "% Comments"
msgstr "% Commentaires"
#: functions.php:157
msgid "January"
msgstr "Janvier"
#: functions.php:78
#: functions.php:160
msgid "February"
msgstr "Février"
#: functions.php:81
#: functions.php:163
msgid "March"
msgstr "Mars"
#: functions.php:84
#: functions.php:166
msgid "April"
msgstr "Avril"
#: functions.php:87
#: functions.php:169
msgid "May"
msgstr "Mai"
#: functions.php:90
#: functions.php:172
msgid "June"
msgstr "Juin"
#: functions.php:93
#: functions.php:175
msgid "July"
msgstr "Juillet"
#: functions.php:96
#: functions.php:178
msgid "August"
msgstr "Août"
#: functions.php:99
#: functions.php:181
msgid "September"
msgstr "Septembre"
#: functions.php:102
#: functions.php:184
msgid "October"
msgstr "Octobre"
#: functions.php:105
#: functions.php:187
msgid "November"
msgstr "Novembre"
#: functions.php:108
#: functions.php:190
msgid "December"
msgstr "Décembre"
#: page-ce-mois-ci.php:186
#: page-ce-mois-ci.php:227
msgid "The"
msgstr "Le"
#: page-ce-mois-ci.php:186
#: page-ce-mois-ci.php:227
msgid "F j, Y, g:i a"
msgstr "d.m.Y à H:i"
#: page-ce-mois-ci.php:187
#: page-ce-mois-ci.php:228
msgid " at "
msgstr " à "
#: page-ce-mois-ci.php:187
#: page-ce-mois-ci.php:228
msgid "Focal"
msgstr "Focale"
#: page-ce-mois-ci.php:335 page-ce-mois-ci.php:336
#: page-ce-mois-ci.php:273
msgid "Tags: "
msgstr "Mot clés: "
#: page-ce-mois-ci.php:288 page-ce-mois-ci.php:289
msgid "Archives"
msgstr "Archives"
#: page-ce-mois-ci.php:336
#: page-ce-mois-ci.php:289
msgid "Help"
msgstr "Aide"
#: page-ce-mois-ci.php:366
#: page-ce-mois-ci.php:329
msgid "Previous Page"
msgstr "Page précédente"
#: page-ce-mois-ci.php:370
#: page-ce-mois-ci.php:333
msgid "Page"
msgstr "Page"
#: page-ce-mois-ci.php:377
#: page-ce-mois-ci.php:340
msgid "Next Page"
msgstr "Page suivante"
#: page-ce-mois-ci.php:389 page-livre.php:73 page.php:58
#: page-ce-mois-ci.php:352 page-livre.php:73
msgid "Pages"
msgstr "Pages"
#: single-post.php:102
msgid "Tags:"
msgstr "Mot clés:"
#: single-post.php:111
msgctxt "post navigation"
msgid "Previous Post"
msgstr "Page précédente"
#: single-post.php:112
msgctxt "post navigation"
msgid "Next Post"
msgstr "Page suivante"
#. Theme Name of the plugin/theme
msgid "TopPic Child"
msgstr ""

View File

@@ -211,22 +211,18 @@ Array
[gps] =>
)
*/
//$title = $imgs['title'];
$mois = strtok($title = $imgs['title'], '_');
/*
$keyword = ZPGetTag($filename, $album, $connexion);
$keyword = "";
if (isset($iptc['2#025'])) {
foreach ($iptc['2#025'] as $key => $val) {
$keyword .= '<a href="' . $host . '/zenphoto/index.php?p=search&amp;words=' . $val . '" title="Tag > ' . $val . '" rel="tag">' . $val . '</a>';
$keyword .= ', ';
if (isset($keyword)) {
foreach ($keyword as $val) {
$tag_cloud .= '<a href="' . $host . '/zenphoto/index.php?p=search&amp;words=' . strtolower($val) . '" title="Tag > ' . strtolower($val) . '" rel="tag">' . strtolower($val) . '</a>';
$tag_cloud .= ', ';
}
$keyword = substr($keyword, 0, -2);
}
$imgs['img_sd']['keyword'] = $keyword;
}
*/
$exifInfo = "";
$exifInfo = __('The','toppic-child') . " " .date(__("F j, Y, g:i a",'toppic-child'),strtotime($imgs['EXIFDateTimeOriginal'])).' - ';
$exifInfo .= $imgs['EXIFExposureTime'] . __(' at ','toppic-child') . $imgs['EXIFFNumber'] .' - ' . $imgs['EXIFISOSpeedRatings'] .' ISO - ' . __('Focal','toppic-child') .$imgs['EXIFFocalLength'];
@@ -248,7 +244,7 @@ Array
<div class="cadre">
<?php if (($imgs['title'] != "") || ($imgs['desc'] != "")) { ?>
<p class="titrePhoto"><?php echo $imgs['title']; ?></p>
<p class="titrePhoto"><?php echo mois2($mois); ?></p>
<p class="legendePhoto"><?php echo $imgs['desc']; ?></p>
<?php }
@@ -272,13 +268,10 @@ Array
</div><!-- /cadre -->
<?php if (($imgs['img_sd']['titre'] != "") || ($imgs['img_sd']['legende'] != "")) { ?>
<p class="titrePhoto"><?php echo $imgs['img_sd']['titre']; ?>Titre</p>
<p class="legendePhoto"><?php echo $imgs['img_sd']['legende']; ?>Légende</p>
<?php } ?>
<p class="exifs"><?php echo $imgs['exif']; ?></p>
<p class="tags"><?php echo _e("Tags: ",'toppic-child') . $tag_cloud; ?></p>
<!-- /image du mois -->
<?php } ?>
@@ -331,18 +324,22 @@ $nbpages = ceil(count($images_du_mois) / 12);
$prec = $ppage - 1;
$suiv = $ppage + 1;
if ($ppage >= 2) echo '<a class="prev page-numbers" href="'.$_SERVER['REQUEST_URI'].'?page='.$prec.'" title="'.gettext("Previous Page").'"> ← </a>&nbsp;';
echo '<ul class="paginate">';
if ($ppage >= 2) echo "<li class='previous-off'><a href='" . $_SERVER['REQUEST_URI'] . "?page=" .$prec . "' title='" . gettext("Previous Page") . "'>&laquo;</a></li>";
for ($i = 1; $i <= $nbpages; $i++) {
if ($i != $ppage) {
echo '<a class="page-numbers" href="'.$_SERVER['REQUEST_URI'].'?page='.$i.'" title="'.gettext("Page").' '.$i.'">'.$i.' </a>&nbsp;';
echo "<li><a href='" . $_SERVER['REQUEST_URI'] . "?page=" . $i . "' title='" . gettext("Page") . " " . $i . "'>$i</a></li>";
}
else {
echo "<span class='current page-numbers'>".$i."</span>&nbsp;&nbsp;";
echo "<li><a href='' class='active'>" . $i . "</a></li>";
}
}
if ($page < $nbpages) echo '<a class="next page-numbers" href="'.$_SERVER['REQUEST_URI'].'?page='.$suiv.'" title="'.gettext("Next Page").'"> → </a>&nbsp;';
if ($ppage < $nbpages) echo "<li class='next'><a href='" . $_SERVER['REQUEST_URI'] . "?page=" . $suiv.'" title="'.gettext("Next Page") . "'>&raquo;</a></li>";
echo '</ul>';
?>
</div>
@@ -350,8 +347,6 @@ if ($page < $nbpages) echo '<a class="next page-numbers" href="'.$_SERVER['REQUE
</div>
<?php
wp_link_pages( array(
'before' => '<div class="page-links"><span class="page-links-title">' . __( 'Pages', 'toppic' ) . '</span>',

View File

@@ -1,75 +0,0 @@
<?php get_header() ?>
<?php
$kk_parallax = kk_parallax();
$title_type = $kk_parallax[0];
$bg_title_img = $kk_parallax[1];
?>
<?php if ( post_password_required( $post ) ) {
get_template_part( 'password-form' );
} else {
?>
<!-- start main container -->
<div class="content page-content">
<?php if( $title_type == 'parallax' ) { ?>
<div id="kk-parallax-wrapper" class="kk-parallax-wrapper">
<div id="kk-parallax-bg" class="kk-parallax-bg kk-hidden">
<img id="kk-img-check" src="<?php echo esc_url( $bg_title_img ) ?>" alt="<?php echo esc_attr( $kk_parallax[2] ) ?>" />
</div>
<div id="kk-parallax-title-wrapper" class="kk-parallax-title-wrapper">
<div id="kk-parallax-title" class="page-title">
<?php the_title( '<h1>', '</h1>' ); ?>
</div>
</div>
<a id="kk-down" class="kk-down is-loading" href="#kk-to-me"></a>
</div>
<?php } ?>
<div class="content-inner-wrapper clearfix">
<span id="kk-to-me"></span>
<?php if( $title_type == 'default' ) { ?>
<div class="post-title">
<?php the_title( '<h1>', '</h1>' ); ?>
</div>
<div class="divider clear"></div>
<?php } ?>
<div class="inner-content">
<?php the_post(); ?>
<?php the_content (); ?>
<?php
wp_link_pages( array(
'before' => '<div class="page-links"><span class="page-links-title">' . __( 'Pages', 'toppic' ) . '</span>',
'after' => '</div>',
'link_before' => '<span class="link-num">',
'link_after' => '</span>'
)
);
?>
</div>
</div>
<?php get_template_part('extends/footer-area') ?>
</div>
<!-- end container -->
<?php } ?>
<?php get_footer()?>

142
single-post.php Executable file
View File

@@ -0,0 +1,142 @@
<?php get_header(); ?>
<?php the_post(); ?>
<?php if(get_option('toppic_theme_blog_sidebar_single') == 'left') {
$position = 'left';
$content_position = 'right';
} else if (get_option('toppic_theme_blog_sidebar_single') == 'right') {
$position = 'right';
$content_position = 'left';
} else if (get_option('toppic_theme_blog_sidebar_single') == 'full') {
$position = 'full';
$content_position = 'none';
} else {
$position = 'right';
$content_position = 'left';
}
$kk_parallax = kk_parallax();
$title_type = $kk_parallax[0];
$bg_title_img = $kk_parallax[1];
?>
<?php if ( post_password_required( $post ) ) {
get_template_part( 'password-form' );
} else { ?>
<!-- start content wrapper -->
<div class="content">
<?php if( $title_type == 'parallax' ) { ?>
<div id="kk-parallax-wrapper" class="kk-parallax-wrapper">
<div id="kk-parallax-bg" class="kk-parallax-bg kk-hidden">
<img id="kk-img-check" src="<?php echo esc_url( $bg_title_img ) ?>" alt="<?php echo esc_attr( $kk_parallax[2] ) ?>" />
</div>
<div id="kk-parallax-title-wrapper" class="kk-parallax-title-wrapper">
<div id="kk-parallax-title" class="page-title">
<h1><?php the_title(); ?></h1>
<?php get_template_part( 'formats/single-post/post-meta' ); ?>
</div>
</div>
<a id="kk-down" class="kk-down is-loading" href="#kk-to-me"></a>
</div>
<?php } ?>
<div class="content-inner-wrapper clearfix">
<span id="kk-to-me"></span>
<?php if( $title_type == 'default' ) { ?>
<div class="post-title">
<h1><?php the_title(); ?></h1>
<?php get_template_part( 'formats/single-post/post-meta' ); ?>
</div>
<div class="divider clear"></div>
<?php } ?>
<div class="inner-content" id="<?php echo esc_attr($content_position) ?>">
<?php
$format = get_post_format();
if( false === $format ) { $format = 'standard'; }
get_template_part( 'formats/single-post/' . $format.'-single' );
?>
<?php if( $format == 'quote' ): ?>
<?php $quoteLink = get_post_meta($post->ID, '_post_quote_source_value', true); ?>
<h2 class="quote-text">
&ldquo;<?php echo get_post_meta($post->ID, '_post_quote_value', true); ?>&rdquo;
</h2>
<?php if ($quoteLink!="") {?>
<span class="quote-source">
&mdash;&nbsp;<?php echo esc_url($quoteLink) ?>
</span>
<?php } ?>
<?php else: ?>
<div class="post-entry">
<?php the_content(); ?>
</div>
<?php endif; ?>
<?php if (has_tag()) { ?>
<div class="post-tags">
<h4><?php _e('Tags:','toppic'); ?></h4>
<?php the_tags('',''); ?>
</div>
<?php } ?>
<div class="post-nav">
<?php
//echo '<div class="post-nav">';
the_post_navigation( array(
'prev_text' => '<span class="nav-link-text">' . esc_html_x( 'Previous Post', 'post navigation', 'toppic-child' ) . '</span><h3 class="entry-title">%title</h3>',
'next_text' => '<span class="nav-link-text">' . esc_html_x( 'Next Post', 'post navigation', 'toppic-child' ) . '</span><h3 class="entry-title">%title</h3>',
'screen_reader_text' =>' '
) );
//echo '</div>';
//echo '<span class="clearfix"></span>';
?>
</div>
<span class="clearfix"></span>
<?php comments_template(); ?>
</div>
<!-- start widgets -->
<?php if (get_option('toppic_theme_blog_sidebar_single') != 'full') {
if(is_active_sidebar("kk-blog-sidebar")) { ?>
<div class="sidebar" id="<?php echo esc_attr($position) ?>">
<?php dynamic_sidebar("kk-blog-sidebar")?>
</div>
<?php } } ?>
<!-- end widgets -->
</div>
<?php get_template_part('extends/footer-area') ?>
</div>
<!-- end content wrapper -->
<?php } ?>
<?php get_footer(); ?>

118
style.css
View File

@@ -68,8 +68,9 @@ div.modele {
}
*/
/* Ce-mois-ci */
#archive {
/**/
margin: 0 0 80px;
}
@@ -83,23 +84,22 @@ div.modele {
border: 1px solid #ccc;
}
.exifs {
.exifs, .tags {
text-align: center;
color: #909090;
font-size: smaller;
margin-bottom: 3em;
margin-top: 1em;
}
/*
.thumb {
width: 200px;
height: 200px;
border: 1px solid #ccc;
background-color: #fff;
.tags a {
color: #727172;
}
*/
.tags a:hover {
color: #dba425;
}
.albumdesc {
float: right;
text-align:center;
@@ -109,11 +109,11 @@ div.modele {
vertical-align: middle;
}
/*
.albumdesc a, .pagination a {
color: #333;
}
*/
.gras {
font-weight: bold;
}
@@ -164,4 +164,98 @@ input.search-field {
border: 1px solid #ccc;
}
.titrePhoto {
font-size: 36px;
font-weight: 200;
line-height: 1.2em;
font-variant: small-caps;
}
.legendePhoto {
}
/* Pagination (Ce. mois. ci) */
.blog-pagination {
text-align: center;
margin-top: 2em;
}
ul.paginate {
display: inline-block;
padding: 0;
margin: 0;
text-align: center;
}
ul.paginate li {display: inline;}
ul.paginate li a {
color: black;
float: left;
padding: 8px 16px;
text-decoration: none;
border-radius: 5px;
}
ul.paginate li a.active {
background-color: #dba425;
color: white;
border-radius: 5px;
}
ul.paginate li a:hover:not(.active) {background-color: #ffbf00;}
/* Post Navigation */
.post-navigation .nav-links a {
color: #999999;
display: inline-block;
font-size: 10px;
font-weight: 600;
text-transform: uppercase;
margin: 0 6px 6px 0;
padding: 2px 9px;
}
.post-navigation .nav-links a:hover {
color: #dba425;
}
.post-navigation {
margin: 0;
padding: 0;
color: #353535;
}
.post-navigation .nav-links .nav-previous {
float: left;
box-sizing: border-box;
padding-right: 0.5em;
max-width: 50%;
}
.post-navigation .nav-links .nav-next {
float: right;
box-sizing: border-box;
padding-left: 0.5em;
max-width: 50%;
}
.post-navigation .nav-links .nav-link-text {
display: block;
}
.post-navigation .nav-links .nav-previous .nav-link-text:before {
margin-right: 3px;
content: "\00AB";
}
.post-navigation .nav-links .nav-next .nav-link-text:after {
margin-left: 4px;
content: "\00BB";
}
.post-navigation .nav-links .entry-title {
margin-bottom: 5px;
}