1er commit

This commit is contained in:
2020-04-21 13:42:20 +02:00
commit d94c985d0e
8 changed files with 452 additions and 0 deletions

1
.gitignore vendored Normal file
View File

@@ -0,0 +1 @@
.DS_Store

View File

@@ -0,0 +1,30 @@
<?php
/*
Template Name: Footer Without Widgets
*/
?>
</div><!-- #content -->
<footer id="colophon" class="site-footer">
<div class="copyright-area">
<p>
<?php
$default_copyright_text = ' &copy; '.get_bloginfo('name').' '.date('Y');
echo get_theme_mod('copyright_text', $default_copyright_text );
?>
</p>
</div>
</footer><!-- #colophon -->
</div><!-- #page -->
<?php if(get_theme_mod('enable_scroll_back_to_top_btn', true)) { ?>
<div class="scroll-back-to-top-btn">
<?php get_template_part('assets/icons/inline', 'arrow_up.svg'); ?>
</div>
<?php } ?>
<?php wp_footer(); ?>
</body>
</html>

34
functions.php Normal file
View File

@@ -0,0 +1,34 @@
<?php
/* enqueue scripts and style from parent theme */
function yuzu_styles() {
//wp_enqueue_style( 'parent', get_template_directory_uri() . '/style.css' );
$parent_style = 'parent'; // This is 'twentyfifteen-style' for the Twenty Fifteen theme.
wp_enqueue_style( $parent_style, get_template_directory_uri() . '/style.css' );
wp_enqueue_style( 'child-style',
get_stylesheet_directory_uri() . '/style.css',
array( $parent_style ),
wp_get_theme()->get('Version')
);
}
add_action( 'wp_enqueue_scripts', 'yuzu_styles');
// Modifier le seuil à 3200px:
add_filter( 'big_image_size_threshold', 'modify_big_image_size_threshold', 10, 4 );
function modify_big_image_size_threshold( $threshold, $imagesize, $file, $attachment_id ) {
return 4096;
}
// Désactiver complètement le seuil maximum:
//add_filter( 'big_image_size_threshold', '__return_false' );
// Infos sur les tailles dimages actives:
//add_action( 'admin_init', 'theme_additional_images' );
function theme_additional_images() {
global $_wp_additional_image_sizes;
echo '<pre>' . print_r($_wp_additional_image_sizes) . '</pre>';
}
?>

122
header.php Normal file
View File

@@ -0,0 +1,122 @@
<?php
/**
* The header for our theme
*
* This is the template that displays all of the <head> section and everything up until <div id="content">
*
* @link https://developer.wordpress.org/themes/basics/template-files/#template-partials
*
* @package Yuzu
*/
?>
<!doctype html>
<html <?php language_attributes(); ?>>
<head>
<meta charset="<?php bloginfo( 'charset' ); ?>">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="profile" href="https://gmpg.org/xfn/11">
<?php wp_head(); ?>
<script type="text/javascript">
var $ =jQuery.noConflict();
$(document).ready(function(){
$( "button#togle" ).click(function() {
$( ".comments-section" ).toggle();
var $sp = $(this).text().trim().split(" ");
if($sp[0] == '<?php _e("Display", "yuzu-child" ); ?>' ){
var e = $("#togle").text(function(index, text) {
return text.replace("<?php _e('Display', 'yuzu-child' ); ?>", "<?php _e('Hide', 'yuzu-child' ); ?>");
});
}
if($sp[0] == '<?php _e("Hide", "yuzu-child" ); ?>' ){
var e = $("#togle").text(function(index, text) {
return text.replace("<?php _e('Hide', 'yuzu-child' ); ?>", "<?php _e('Display', 'yuzu-child' ); ?>");
});
}
//$el.text($el.text() == "<?php _e('Display comments', 'CreatorThemeRes-child' ); ?>" ? "<?php _e('Hide comments', 'CreatorThemeRes-child' ); ?>" : "<?php _e('Display comments', 'CreatorThemeRes-child' ); ?>");
});
});
</script>
</head>
<body <?php body_class(); ?>>
<div id="page" class="site">
<a class="skip-link screen-reader-text" href="#content"><?php esc_html_e( 'Skip to content', 'yuzu' ); ?></a>
<div class="top-search-bar-container">
<div class="super-large-container">
<form role="search" method="get" class="searchform group"
action="<?php echo home_url('/'); ?>">
<input name="s" type="text" placeholder="<?php _e('What are you looking for ... ?', 'yuzu'); ?>">
<div class="submit-top-bar-search">
<label>
<input type="submit" style="display: none;" class="hidden-submit"/>
<?php get_template_part('assets/icons/inline', 'search.svg'); ?>
</label>
</div>
</form>
</div>
</div>
<header id="masthead" class="site-header">
<div class="top-bar-content super-large-container">
<div class="site-branding">
<?php
if ( has_custom_logo() ) {
?>
<div class="site-logo">
<a href="<?= get_home_url(); ?>">
<?= get_custom_logo(); ?>
</a>
</div>
<?php
} else {
?>
<h1 class="site-title"><a href="<?php echo esc_url( home_url( '/' ) ); ?>" rel="home"><?php bloginfo( 'name' ); ?></a></h1>
<?php } ?>
</div>
<nav class="site-navigation">
<?php
wp_nav_menu( array(
'theme_location' => 'menu-1',
'menu_id' => 'primary-menu',
) );
?>
<?php if(get_theme_mod('enable_search_in_top_bar', true)) { ?>
<div class="open-top-bar-search">
<?php get_template_part('assets/icons/inline', 'search.svg'); ?>
</div>
<div class="close-top-bar-search" style="display: none">
<?php get_template_part('assets/icons/inline', 'close.svg'); ?>
</div>
<?php } ?>
</nav>
</div>
</header><!-- #masthead -->
<div class="mobile-navigation">
<nav class="site-navigation">
<?php
wp_nav_menu( array(
'theme_location' => 'menu-1',
'menu_id' => 'mobile-primary-menu',
) );
?>
</nav>
<div class="mobile-navigation-toggle">
<div class="open-icon"><?php get_template_part('assets/icons/inline', 'hamburger.svg'); ?></div>
<div class="close-icon"><?php get_template_part('assets/icons/inline', 'close.svg'); ?></div>
</div>
</div>
<div id="content" class="site-content">

View File

@@ -0,0 +1,46 @@
<?php
/*
Template Name: Page Without Footer
*/
get_header();
?>
<div id="primary" class="content-area">
<main id="main" class="site-main">
<div class="single-page">
<?php
while ( have_posts() ) :
the_post();
?>
<div class="page-header medium-container">
<h1 class="page-title"><?= get_the_title(); ?></h1>
</div>
<div class="entry-content fullwidth-container">
<?php the_content(); ?>
</div>
<?php
// If comments are open or we have at least one comment, load up the comment template.
if ( comments_open() || get_comments_number() ) :
?>
<div class="comments-section">
<?php
comments_template();
?>
</div>
<?php
endif;
endwhile; // End of the loop.
?>
</div>
</main><!-- #main -->
</div><!-- #primary -->
<?php
get_footer('without-widgets');

BIN
screenshot.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 514 KiB

143
single.php Normal file
View File

@@ -0,0 +1,143 @@
<?php
/**
* The template for displaying all single posts
*
* @link https://developer.wordpress.org/themes/basics/template-hierarchy/#single-post
*
* @package Yuzu
*/
get_header();
?>
<div id="primary" class="content-area">
<main id="main" class="site-main">
<div <?php post_class("single-article top-and-bottom-margin"); ?>>
<?php
while ( have_posts() ) :
the_post();
?>
<div class="article-header medium-container">
<div class="article-categories">
<?php
$post_categories = wp_get_post_categories( get_the_ID() );
foreach($post_categories as $c){
$cat = get_category( $c );
?>
<a href="<?= get_term_link($c); ?>" class="article-category">
<?= $cat->name; ?>
</a>
<?php
}
?>
</div>
<h1 class="article-title"><?= get_the_title(); ?></h1>
<?php if(get_theme_mod('display_posts_meta', true)) { ?>
<div class="article-meta">
<a href="<?php echo get_author_posts_url( get_the_author_meta( 'ID' ) ); ?>" class="author-picture" style="background-image: url(<?= get_avatar_url(get_the_author_meta('ID')) ?>"></a>
<a href="<?php echo get_author_posts_url( get_the_author_meta( 'ID' ) ); ?>"><?php the_author(); ?></a>
|
<?= get_the_date(); ?>
</div>
<?php } ?>
<?php //printLikes(get_the_ID()); ?>
</div>
<?php
# Image à la une
$featured_image = get_the_post_thumbnail_url(get_the_ID(),'large');
if($featured_image) { ?>
<!--div class="article-featured-image fullwidth-container">
<img src="<?= $featured_image; ?>">
</div-->
<?php
}
?>
<div class="entry-content fullwidth-container">
<?php
the_content();
wp_link_pages();
?>
<?php if(has_tag()) : ?>
<div class="post-tags">
<!--h4><?php //esc_html_e( 'Tags:', 'yuzu-child' ); ?></h4-->
<?php the_tags('',''); ?>
</div>
<?php endif; ?>
</div>
<?php if(get_theme_mod('display_posts_navigation', true)) { ?>
<div class="related-posts">
<?php
$prev_post = get_previous_post();
if (!empty( $prev_post )){ ?>
<a href="<?= get_permalink($prev_post->ID); ?>" class="previous-post">
<div class="background"
style="background-image: url(<?= get_the_post_thumbnail_url($prev_post->ID,'large'); ?>"></div>
<div class="filter"></div>
<div class="content">
<div class="label">
<?php _e('Previous Post', 'yuzu'); ?>
</div>
<h3 class="post-title"><?= $prev_post->post_title; ?></h3>
</div>
</a>
<?php
}
$next_post = get_next_post();
if (!empty( $next_post )){ ?>
<a href="<?= get_permalink($next_post->ID); ?>" class="next-post">
<div class="background"
style="background-image: url(<?= get_the_post_thumbnail_url($next_post->ID,'large'); ?>"></div>
<div class="filter"></div>
<div class="content">
<div class="label">
<?php _e('Next Post', 'yuzu'); ?>
</div>
<h3 class="post-title"><?= $next_post->post_title; ?></h3>
</div>
</a>
<?php
}
?>
</div>
<?php } ?>
<div class="clear"></div>
<?php if ( comments_open() || '0' != get_comments_number() ) : ?>
<div class="home_blog_box">
<button id="togle">
<?php
_e('Display','yuzu-child');
comments_number(esc_html__(' 0 comment','yuzu-child'), esc_html__(' 1 comment','yuzu-child'), '% '.esc_html__(' comments','yuzu-child') );
?>
</button>
<!--div class="comments_cont"-->
<div class="comments-section">
<?php
// If comments are open or we have at least one comment, load up the comment template
comments_template( '', true );
?>
</div>
</div>
<?php endif;
endwhile; // End of the loop.
?>
</div>
</main><!-- #main -->
</div><!-- #primary -->
<?php
get_footer();

76
style.css Normal file
View File

@@ -0,0 +1,76 @@
/*
Theme Name: Yuzu Child Theme
Theme URI: https://example.com
Description: A child theme for Yuzu.
Author: Bruno Pesenti
Author URI: https://example.com/
Template: yuzu
Version: 1.0
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
*/
.clear { clear: both; }
.single .post-tags a {
border: 1px solid #DDDDDD;
color: #999999;
display: inline-block;
font-size: 10px;
font-weight: 600;
text-transform: uppercase;
margin: 0 6px 6px 0;
padding: 2px 9px;
}
.single .post-tags a:hover {
color: #fff;
background-color: #dba425;
}
.single .post-tags h4 {
display: inline-block;
font-size: 14px;
text-transform: uppercase;
font-weight: 600;
margin: 0 5px 0 0;
}
.post-tags {
overflow: hidden;
margin-top: 20px;
text-align: center;
}
.single-article .related-posts .previous-post,
.single-article .related-posts .next-post {
/* height: 300px; */
height: 200px;
}
@media screen and (max-width: 376px) {
.single-article .related-posts .previous-post,
.single-article .related-posts .next-post {
/* height: 250px; */
height: 150px;
}
}
button {
border: 1px solid #DDDDDD !important;
padding: 10px 15px;
color: #999999;
font-size: 18px;
border: none;
margin: 0 0 5px;
cursor: pointer;
background-color: transparent !important;
}
.home_blog_box {
overflow: hidden;
margin-top: 30px;
text-align: center;
margin-bottom: 30px;
}
.comments-section {
display: none;
}