From b4af1c2afd0e7421bc324b48e69f6162a04edca7 Mon Sep 17 00:00:00 2001 From: Bruno 21 Date: Thu, 10 Jan 2019 11:05:40 +0100 Subject: [PATCH] Post navigation MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit article suivant / articje précédent --- functions.php | 88 ++++++++++++++++++++++++++++- page.php | 75 ------------------------- single-post.php | 146 ++++++++++++++++++++++++++++++++++++++++++++++++ style.css | 64 +++++++++++++++++++++ 4 files changed, 296 insertions(+), 77 deletions(-) delete mode 100755 page.php create mode 100755 single-post.php diff --git a/functions.php b/functions.php index dbf34e3..ffd9e90 100755 --- a/functions.php +++ b/functions.php @@ -26,10 +26,92 @@ function kkHideUpdateNotice() { /* WRITE YOUR OWN FUNCTIONS BELOW /*-----------------------------------------------------------------------------------*/ +/* + + + + +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: + + + + corps à la fin: + + + + + + + + +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); @@ -359,7 +441,7 @@ function displayRetina ($file,$album) { 'height' => $size_hd[1] ); } - elseif (file_exists($file_sd)) { + if (file_exists($file_sd)) { $th_sd = true; $size_sd = getimagesize($file_sd, $info); $thumb['sd'] = array( @@ -368,7 +450,7 @@ function displayRetina ($file,$album) { 'height' => $size_sd[1] ); } - else { + if (($th_sd == false) || ($th_hd == false)) { $notfound = "../zenphoto/zp-core/images/err-imagenotfound.png"; $size_sd = getimagesize($notfound, $info); $thumb['sd'] = array( @@ -388,6 +470,8 @@ function displayRetina ($file,$album) { $standard = $thumb['hd']['url'] . ' 400w'; } +//print_r($standard); + $display = '
'; $display .= '
'; $display .= ''; diff --git a/page.php b/page.php deleted file mode 100755 index 6de0d76..0000000 --- a/page.php +++ /dev/null @@ -1,75 +0,0 @@ - - - - - -
- - - - - - - -
- - - -
- ', '' ); ?> -
- -
- - - -
- - - - - '', - 'link_before' => '', - 'link_after' => '' - ) - ); - ?> -
- -
- - - -
- - - - \ No newline at end of file diff --git a/single-post.php b/single-post.php new file mode 100755 index 0000000..b9cf87f --- /dev/null +++ b/single-post.php @@ -0,0 +1,146 @@ + + + + + + + + +
+ + + +
+ +
+ <?php echo esc_attr( $kk_parallax[2] ) ?> +
+ +
+
+

+ + +
+
+ + + +
+ + + +
+ + + +
+

+ + +
+ +
+ + + +
+ + + + + + ID, '_post_quote_source_value', true); ?> + +

+ “ID, '_post_quote_value', true); ?>” +

+ + + + —  + + + + + +
+ +
+ + + + + + + + + + +
+ '; + the_post_navigation( array( + 'prev_text' => '' . esc_html_x( 'Previous Post', 'post navigation', 'toppic-child' ) . '

%title

', + 'next_text' => '' . esc_html_x( 'Next Post', 'post navigation', 'toppic-child' ) . '

%title

', + 'screen_reader_text' =>' ' + ) ); + //echo '
'; + //echo ''; + ?> +
+ + + + +
+ + + + + + + +
+ + + +
+ + + + \ No newline at end of file diff --git a/style.css b/style.css index 1d21efe..4026b5d 100755 --- a/style.css +++ b/style.css @@ -164,6 +164,13 @@ input.search-field { border: 1px solid #ccc; } +. titrePhoto { + } + +.legendePhoto { + } + + /* Pagination (Ce. mois. ci) */ .blog-pagination { @@ -191,3 +198,60 @@ ul.paginate li a.active { 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; +} +