Skip to content

Commit

Permalink
correctifs divers
Browse files Browse the repository at this point in the history
  • Loading branch information
ms-studio committed Mar 27, 2018
1 parent 8653fcc commit 05a2f00
Show file tree
Hide file tree
Showing 4 changed files with 42 additions and 20 deletions.
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,6 @@ Pour réaliser cela, on utilise l'extension [Advanced Custom Fields](https://www
Pour que cela fonctionne:

- Le champ image, dans ACF, doit avoir l'identifiant "image_accueil".
- Le réglage du champ image doit être "Données de l'image (array)" (en anglais: Object (array of data)).
- Le réglage du champ image doit être "Données de l'image (array)" (en anglais: Object (array of data)).

Note: vous pouvez utiliser [Github Updater](https://github.com/afragen/github-updater) pour mettre à jour ce thème.
38 changes: 22 additions & 16 deletions functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,12 @@ function deppo_slmn_enqueue_styles() {

wp_enqueue_style( 'parent-style', get_template_directory_uri() . '/style.css' );


// corrige un bug de Deppo: deppo-font-enqueue

wp_enqueue_style( 'hkgrotesk-style', get_template_directory_uri() . '/assets/fonts/hk-grotesk/stylesheet.css' );


}


Expand All @@ -23,23 +29,10 @@ function deppo_slmn_enqueue_styles() {
*
* @since deppo 1.0
*/
function deppo_slmn_slider_featured_image() {

// vérifier si on a une image ACF:

if (function_exists('get_field')) {

$image = get_field('image_accueil');
$size = 'full'; // (thumbnail, medium, large, full or custom size)

if( $image ) {

echo wp_get_attachment_image( $image['id'], 'full' );

}

function deppo_slmn_slider_featured_image() {

} else if ( has_post_thumbnail() ) :
if ( has_post_thumbnail() ) :

?>

Expand Down Expand Up @@ -68,7 +61,20 @@ function deppo_slmn_slider_featured_image() {
if ( $display_post_nav == 0 ) { ?>
<a href="<?php the_permalink(); ?>">
<?php }
the_post_thumbnail($thumb_size);

// vérifier si on a une image ACF:
$acf_image = get_field('image_accueil');

if( $acf_image ) {

echo wp_get_attachment_image( $acf_image['id'], $thumb_size );

} else {

the_post_thumbnail($thumb_size);

}

if ( $display_post_nav == 0 ) { ?>
</a>
<?php } ?>
Expand Down
6 changes: 4 additions & 2 deletions style.css
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
/*
Theme Name: Deppo-Slmn
Theme URI: https://github.com/eracom-gr361
Theme URI: https://github.com/eracom-gr361/deppo-slmn
GitHub Theme URI: https://github.com/eracom-gr361/deppo-slmn
Author: Eracom GR361
Author URI: https://github.com/eracom-gr361
Template: deppo
Description: Theme enfant de Deppo
Version: 1.0.0
Version: 1.0.1
License: GNU General Public License v2 or later
License URI: LICENSE
Text Domain: deppo
Expand Down
14 changes: 13 additions & 1 deletion template-parts/content-slider.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,19 @@

<div class="slider-item-wrapper">

<?php deppo_slmn_slider_featured_image(); ?>
<?php

if (function_exists('get_field')) {

deppo_slmn_slider_featured_image();

} else {

deppo_slider_featured_image();

}

?>

<header class="entry-header">
<?php
Expand Down

0 comments on commit 05a2f00

Please sign in to comment.