Commit c798308f authored by okhin's avatar okhin 🚴

Ajout des fichiers de thème existants

parent 51d4b89d
Pipeline #2486 passed with stage
in 5 seconds
<?php
/**
* The template for displaying 404 pages (not found).
*
* @package apprenti
*/
get_header(); ?>
<div class="container">
<div class="row">
<section id="primary" class="content-area <?php apprenti_layout_class( 'content' ); ?>">
<main id="main" class="site-main" role="main">
<div id="post-wrapper" class="post-wrapper post-wrapper-single post-wrapper-404">
<section class="error-404 not-found">
<img style =" width: 40%;
margin: 4% 30%;" id="oops" src="https://www.laquadrature.net/wp-content/themes/apprenti/img/<?php echo rand(1, 5);?>.gif">
<?php the_widget( 'WP_Widget_Search' ); ?>
</section><!-- .error-404 -->
</div><!-- .post-wrapper -->
</main><!-- #main -->
</section><!-- #primary -->
<?php get_sidebar(); ?>
</div><!-- .row -->
</div><!-- .container -->
<?php get_footer(); ?>
<?php
/**
Template name: Page RP
*/
get_header(); ?>
<div class="container">
<div class="row">
<section id="primary" class="content-area <?php apprenti_layout_class( 'content' ); ?>">
<main id="main" class="site-main" role="main">
<header class="entry-header entry-header-single">
<?php the_title( '<h1 id="titlerp" class="title-champs">', '</h1>' ); ?>
</header><!-- .entry-header -->
<?php if ( have_posts() ) : $i=0; ?>
<div id="post-wrapper" class="post-wrapper post-wrapper-archive">
<?php /* Start the Loop */ ?>
<?php //query_posts('cat=-61'); while ( have_posts() ) : the_post(); ?>
<?php// while ( have_posts() ) : the_post(); ?>
<?php $paged = (get_query_var('paged')) ? get_query_var('paged') : 1; query_posts("cat=61&paged=$paged"); ?>
<?php while (have_posts()) : the_post(); ?>
<?php
/* Include the Post-Format-specific template for the content.
* If you want to override this in a child theme, then include a file
* called content-___.php (where ___ is the Post Format name) and that will be used instead.
*/
include(locate_template('template-parts/content.php'));
//get_template_part( 'template-parts/content', get_post_format() );
?>
<?php $i++; endwhile; ?>
</div><!-- .post-wrapper -->
<?php apprenti_the_posts_pagination(); ?>
<?php else : ?>
<?php get_template_part( 'template-parts/content', 'none' ); ?>
<?php endif; ?>
</main><!-- #main -->
</section><!-- #primary -->
<?php get_sidebar(); ?>
</div><!-- .row -->
</div><!-- .container -->
<?php get_footer(); ?>
<?php
/**
* The template for displaying archive pages.
*
* Learn more: http://codex.wordpress.org/Template_Hierarchy
*
* @package apprenti
*/
get_header(); ?>
<div class="container">
<div class="row">
<section id="primary" class="content-area <?php apprenti_layout_class( 'content' ); ?>">
<main id="main" class="site-main" role="main">
<?php if ( have_posts() ) : ?>
<?php insecable();?>
<header class="page-header">
<?php
the_archive_title( '<h1 class="page-title">', '</h1>' );
the_archive_description( '<div class="taxonomy-description">', '</div>' );
?>
</header><!-- .page-header -->
<div id="post-wrapper" class="post-wrapper post-wrapper-archive">
<?php /* Start the Loop */ ?>
<?php while ( have_posts() ) : the_post(); ?>
<?php
/* Include the Post-Format-specific template for the content.
* If you want to override this in a child theme, then include a file
* called content-___.php (where ___ is the Post Format name) and that will be used instead.
*/
get_template_part( 'template-parts/content', get_post_format() );
?>
<?php endwhile; ?>
</div><!-- .post-wrapper -->
<?php apprenti_the_posts_pagination(); ?>
<?php else : ?>
<?php get_template_part( 'template-parts/content', 'none' ); ?>
<?php endif; ?>
</main><!-- #main -->
</section><!-- #primary -->
<?php get_sidebar(); ?>
</div><!-- .row -->
</div><!-- .container -->
<?php get_footer(); ?>
<?php
/**
* The template for displaying Comments.
*
* The area of the page that contains both current comments
* and the comment form. The actual display of comments is
* handled by a callback to apprenti_comment() which is
* located in the inc/template-tags.php file.
*
* @package apprenti
*/
/*
* If the current post is protected by a password and
* the visitor has not yet entered the password we will
* return early without loading the comments.
*/
if ( post_password_required() ) {
return;
}
?>
<div id="comments" class="comments-area">
<?php // You can start editing here -- including this comment! ?>
<?php if ( have_comments() ) : ?>
<div class="comments-area-wrapper">
<h2 class="comments-title">
<?php
$comments_number = get_comments_number();
if ( '1' === $comments_number ) {
printf(
/* translators: %s: post title */
esc_html( _x( 'One Reply to &ldquo;%s&rdquo;', 'comments title', 'apprenti' ) ),
get_the_title()
);
} else {
printf(
/* translators: 1: number of comments, 2: post title */
esc_html( _nx(
'%1$s Reply to &ldquo;%2$s&rdquo;',
'%1$s Replies to &ldquo;%2$s&rdquo;',
$comments_number,
'comments title',
'apprenti'
) ),
number_format_i18n( $comments_number ),
get_the_title()
);
}
?>
</h2>
<?php if ( get_comment_pages_count() > 1 && get_option( 'page_comments' ) ) : ?>
<nav id="comment-nav-above" class="navigation comment-navigation comment-navigation-above" role="navigation">
<h1 class="screen-reader-text"><?php esc_html_e( 'Comment navigation', 'apprenti' ); ?></h1>
<div class="nav-links">
<div class="nav-previous"><?php previous_comments_link( esc_html__( 'Older Comments', 'apprenti' ) ); ?></div>
<div class="nav-next"><?php next_comments_link( esc_html__( 'Newer Comments', 'apprenti' ) ); ?></div>
</div><!-- .nav-links -->
</nav><!-- #comment-nav-above -->
<?php endif; // check for comment navigation ?>
<ol class="comment-list">
<?php
wp_list_comments( array(
'style' => 'ol',
'short_ping' => true,
'avatar_size' => 68,
) );
?>
</ol><!-- .comment-list -->
<?php if ( get_comment_pages_count() > 1 && get_option( 'page_comments' ) ) : // are there comments to navigate through ?>
<nav id="comment-nav-below" class="navigation comment-navigation comment-navigation-below" role="navigation">
<h1 class="screen-reader-text"><?php esc_html_e( 'Comment navigation', 'apprenti' ); ?></h1>
<div class="nav-links">
<div class="nav-previous"><?php previous_comments_link( esc_html__( 'Older Comments', 'apprenti' ) ); ?></div>
<div class="nav-next"><?php next_comments_link( esc_html__( 'Newer Comments', 'apprenti' ) ); ?></div>
</div><!-- .nav-links -->
</nav><!-- #comment-nav-above -->
<?php endif; // check for comment navigation ?>
</div><!-- .comments-area-wrapper -->
<?php endif; // have_comments() ?>
<?php
// If comments are closed and there are comments, let's leave a little note, shall we?
if ( ! comments_open() && '0' != get_comments_number() && post_type_supports( get_post_type(), 'comments' ) ) :
?>
<div class="no-comments-wrapper">
<p class="no-comments"><?php esc_html_e( 'Comments are closed.', 'apprenti' ); ?></p>
</div><!-- .comments-area-wrapper -->
<?php endif; ?>
<?php comment_form(); ?>
</div><!-- #comments -->
<?php
/**
* The template for displaying the footer.
*
* Contains the closing of the #content div and all content after
*
* @package apprenti
*/
?>
</div><!-- #content -->
<footer id="colophon" class="site-footer" role="contentinfo">
<?php
// Site Info
get_template_part( 'template-parts/site-info' );
?>
</footer><!-- #colophon -->
</div><!-- #page .site-wrapper -->
<div class="overlay-effect"></div><!-- .overlay-effect -->
<?php wp_footer(); ?>
</body>
</html>
/*
* functions.php
* Licence GNU General Public Licence v3 or more
* https://www.gnu.org/licenses/gpl.html
<?php
/**
* apprenti functions and definitions
*
* Ce fichier sert à regrouper toutes les fonctions spécifiques au thème
* troisquatorze.
* @package apprenti
*/
if ( ! function_exists( 'apprenti_setup' ) ) :
/**
* Sets up theme defaults and registers support for various WordPress features.
*
* Note that this function is hooked into the after_setup_theme hook, which
* runs before the init hook. The init hook is too late for some features, such
* as indicating support for post thumbnails.
*/
function apprenti_setup() {
/*
* Make theme available for translation.
* Translations can be filed in the /languages/ directory.
* If you're building a theme based on apprenti, use a find and replace
* to change 'apprenti' to the name of your theme in all the template files
*/
load_theme_textdomain( 'apprenti', get_template_directory() . '/languages' );
// Add default posts and comments RSS feed links to head.
add_theme_support( 'automatic-feed-links' );
/*
* Let WordPress manage the document title.
* By adding theme support, we declare that this theme does not use a
* hard-coded <title> tag in the document head, and expect WordPress to
* provide it for us.
*/
add_theme_support( 'title-tag' );
/*
* Enable support for custom logo.
*
* @link https://codex.wordpress.org/Theme_Logo
*/
add_theme_support( 'custom-logo', array(
'height' => 400,
'width' => 580,
'flex-height' => true,
'flex-width' => true,
'header-text' => array( 'site-title', 'site-description' ),
) );
/*
* Enable support for Post Thumbnails on posts and pages.
*
* @link http://codex.wordpress.org/Function_Reference/add_theme_support#Post_Thumbnails
*/
add_theme_support( 'post-thumbnails' );
// Theme Image Sizes
add_image_size( 'apprenti-featured2', 640, 360, true ); // Retina Image (2x)
add_image_size( 'apprenti-featured-normal', 330, 288, true ); // Normal Image (1x)
// This theme uses wp_nav_menu() in four locations.
register_nav_menus( array (
'header-menu' => esc_html__( 'Header Menu', 'apprenti' ),
) );
// This theme styles the visual editor to resemble the theme style.
add_editor_style( array ( 'css/editor-style.css', apprenti_fonts_url() ) );
/*
* Switch default core markup for search form, comment form, and comments
* to output valid HTML5.
*/
add_theme_support( 'html5', array (
'comment-form', 'comment-list', 'gallery', 'caption'
) );
// Setup the WordPress core custom background feature.
add_theme_support( 'custom-background', apply_filters( 'apprenti_custom_background_args', array (
'default-color' => 'f8f8f8',
'default-image' => '',
) ) );
// Add theme support for selective refresh for widgets.
add_theme_support( 'customize-selective-refresh-widgets' );
}
endif; // apprenti_setup
add_action( 'after_setup_theme', 'apprenti_setup' );
/**
* Set the content width in pixels, based on the theme's design and stylesheet.
*
* Priority 0 to make it available to lower priority callbacks.
*
* @global int $content_width
*/
function apprenti_content_width() {
$GLOBALS['content_width'] = apply_filters( 'apprenti_content_width', 758 );
}
add_action( 'after_setup_theme', 'apprenti_content_width', 0 );
/**
* Register widget area.
*
* @link http://codex.wordpress.org/Function_Reference/register_sidebar
*/
function apprenti_widgets_init() {
// Widget Areas
register_sidebar( array(
'name' => esc_html__( 'Main Sidebar', 'apprenti' ),
'id' => 'sidebar-1',
'before_widget' => '<aside id="%1$s" class="widget %2$s">',
'after_widget' => '</aside>',
'before_title' => '<h2 class="widget-title">',
'after_title' => '</h2>',
) );
}
add_action( 'widgets_init', 'apprenti_widgets_init' );
/**
* Enqueue scripts and styles.
*/
function apprenti_scripts() {
/**
* Enqueue JS files
*/
// Enquire
wp_enqueue_script( 'enquire', get_template_directory_uri() . '/js/enquire.js', array( 'jquery' ), '2.1.2', true );
// Fitvids
wp_enqueue_script( 'fitvids', get_template_directory_uri() . '/js/fitvids.js', array( 'jquery' ), '1.1', true );
// Superfish Menu
wp_enqueue_script( 'hover-intent', get_template_directory_uri() . '/js/hover-intent.js', array( 'jquery' ), 'r7', true );
wp_enqueue_script( 'superfish', get_template_directory_uri() . '/js/superfish.js', array( 'jquery' ), '1.7.5', true );
// Comment Reply
if ( is_singular() && comments_open() && get_option( 'thread_comments' ) ) {
wp_enqueue_script( 'comment-reply' );
}
// Keyboard image navigation support
if ( is_singular() && wp_attachment_is_image() ) {
wp_enqueue_script( 'apprenti-keyboard-image-navigation', get_template_directory_uri() . '/js/keyboard-image-navigation.js', array( 'jquery' ), '20140127', true );
}
// Custom Script
wp_enqueue_script( 'apprenti-custom', get_template_directory_uri() . '/js/custom-min.js', array( 'jquery' ), '1.0', true );
/**
* Enqueue CSS files
*/
// Bootstrap Custom
wp_enqueue_style( 'apprenti-bootstrap-custom', get_template_directory_uri() . '/css/bootstrap-custom.css' );
// Font Awesome 5
// For Reviewers / Developers: Unique Handle `font-awesome-5` is required to avoid the overwrite conflicts with Font Awesome 4 library.
// Font Awesome 5 library is rewritten and is different from Font Awesome 4 library.
wp_enqueue_style( 'font-awesome-5', get_template_directory_uri() . '/css/fontawesome-all.css' );
// Fonts
wp_enqueue_style( 'apprenti-fonts', apprenti_fonts_url(), array(), null );
// Theme Stylesheet
wp_enqueue_style( 'apprenti-style', get_stylesheet_uri() );
}
add_action( 'wp_enqueue_scripts', 'apprenti_scripts' );
/**
* Custom functions that act independently of the theme templates.
*/
require get_template_directory() . '/inc/extras.php';
/**
* Custom template tags for this theme.
*/
require get_template_directory() . '/inc/template-tags.php';
/**
* Custom functions that act independently of the theme templates.
*/
require get_template_directory() . '/inc/deprecated.php';
/**
* Implement the Custom Header feature.
*/
require get_template_directory() . '/inc/custom-header.php';
/**
* Customizer additions.
*/
require get_template_directory() . '/inc/customizer.php';
function wp_trim_all_excerpt($text) { // Creates an excerpt if needed; and shortens the manual excerpt as well
global $post;
if ( '' == $text ) {
$text = get_the_content('');
$text = apply_filters('the_content', $text);
$text = str_replace(']]>', ']]>', $text);
}
$text = strip_shortcodes( $text ); // optional
$text = strip_tags($text);
$excerpt_length = apply_filters('excerpt_length', 300);
$excerpt_more = apply_filters('excerpt_more', ' ' . '[...]');
$words = explode(' ', $text, $excerpt_length + 1);
if (count($words)> $excerpt_length) {
array_pop($words);
$text = implode(' ', $words);
$text = $text . $excerpt_more;
} else {
$text = implode(' ', $words);
}
return $text;
}
remove_filter('get_the_excerpt', 'wp_trim_excerpt');
add_filter('get_the_excerpt', 'wp_trim_all_excerpt');
if (! function_exists( 'exclure_pages_recherche' ) ):
/*
** Exclut les pages de la recherche Wordpress
** Retourne seulement les articles
*/
function exclure_pages_recherche($query) {
if ($query->is_search) {
$query->set('post_type', 'post');
}
return $query;
}
add_filter('pre_get_posts','exclure_pages_recherche');
endif;
// search filter
function my_search_filter( $query )
{
if ( $query->is_search )
{
$query->set( 'category__not_in',array(61) );
}
return $query;
}
add_filter('pre_get_posts','my_search_filter');
function insecable($content="") {
$content = preg_replace('# ([?!:;»])#u', '&nbsp;\1', $content);
$content = preg_replace('#« #', '«&nbsp;', $content);
// Titres
$content = preg_replace( '#<h(\d)>(.*)</#U' , '<h\1 id="\2">\2</' , $content );
return $content;
}
add_filter('the_content','insecable');
add_filter('the_title','insecable');
function main_query ( $query1 ) {
if ( $query1->is_page() && $query1->is_main_query() ) {
$query1->set( 'offset', '1' );
}
}
add_action( 'pre_get_posts', 'main_query' );
\ No newline at end of file
<?php
/**
* Wisteria functions and definitions
*
* @package Wisteria
*/
if ( ! function_exists( 'wisteria_setup' ) ) :
/**
* Sets up theme defaults and registers support for various WordPress features.
*
* Note that this function is hooked into the after_setup_theme hook, which
* runs before the init hook. The init hook is too late for some features, such
* as indicating support for post thumbnails.
*/
function wisteria_setup() {
/*
* Make theme available for translation.
* Translations can be filed in the /languages/ directory.
* If you're building a theme based on Wisteria, use a find and replace
* to change 'wisteria' to the name of your theme in all the template files
*/
load_theme_textdomain( 'wisteria', get_template_directory() . '/languages' );
// Add default posts and comments RSS feed links to head.
add_theme_support( 'automatic-feed-links' );
/*
* Let WordPress manage the document title.
* By adding theme support, we declare that this theme does not use a
* hard-coded <title> tag in the document head, and expect WordPress to
* provide it for us.
*/
add_theme_support( 'title-tag' );
/*
* Enable support for custom logo.
*
* @link https://codex.wordpress.org/Theme_Logo
*/
add_theme_support( 'custom-logo', array(
'height' => 400,
'width' => 580,
'flex-height' => true,
'flex-width' => true,
'header-text' => array( 'site-title', 'site-description' ),
) );
/*
* Enable support for Post Thumbnails on posts and pages.
*
* @link http://codex.wordpress.org/Function_Reference/add_theme_support#Post_Thumbnails
*/
add_theme_support( 'post-thumbnails' );
// Theme Image Sizes
add_image_size( 'wisteria-featured2', 640, 360, true ); // Retina Image (2x)
add_image_size( 'wisteria-featured-normal', 330, 288, true ); // Normal Image (1x)
// This theme uses wp_nav_menu() in four locations.
register_nav_menus( array (
'header-menu' => esc_html__( 'Header Menu', 'wisteria' ),
) );
// This theme styles the visual editor to resemble the theme style.
add_editor_style( array ( 'css/editor-style.css', wisteria_fonts_url() ) );
/*
* Switch default core markup for search form, comment form, and comments
* to output valid HTML5.
*/
add_theme_support( 'html5', array (
'comment-form', 'comment-list', 'gallery', 'caption'
) );
// Setup the WordPress core custom background feature.
add_theme_support( 'custom-background', apply_filters( 'wisteria_custom_background_args', array (
'default-color' => 'f8f8f8',
'default-image' => '',
) ) );
// Add theme support for selective refresh for widgets.
add_theme_support( 'customize-selective-refresh-widgets' );
}
endif; // wisteria_setup
add_action( 'after_setup_theme', 'wisteria_setup' );
/**
* Set the content width in pixels, based on the theme's design and stylesheet.
*
* Priority 0 to make it available to lower priority callbacks.
*
* @global int $content_width
*/
function wisteria_content_width() {
$GLOBALS['content_width'] = apply_filters( 'wisteria_content_width', 758 );
}
add_action( 'after_setup_theme', 'wisteria_content_width', 0 );
/**
* Register widget area.
*
* @link http://codex.wordpress.org/Function_Reference/register_sidebar
*/
function wisteria_widgets_init() {
// Widget Areas
register_sidebar( array(
'name' => esc_html__( 'Main Sidebar', 'wisteria' ),
'id' => 'sidebar-1',
'before_widget' => '<aside id="%1$s" class="widget %2$s">',
'after_widget' => '</aside>',
'before_title' => '<h2 class="widget-title">',
'after_title' => '</h2>',
) );
}
add_action( 'widgets_init', 'wisteria_widgets_init' );
/**
* Enqueue scripts and styles.
*/
function wisteria_scripts() {
/**
* Enqueue JS files
*/
// Enquire
wp_enqueue_script( 'enquire', get_template_directory_uri() . '/js/enquire.js', array( 'jquery' ), '2.1.2', true );
// Fitvids
wp_enqueue_script( 'fitvids', get_template_directory_uri() . '/js/fitvids.js', array( 'jquery' ), '1.1', true );
// Superfish Menu
wp_enqueue_script( 'hover-intent', get_template_directory_uri() . '/js/hover-intent.js', array( 'jquery' ), 'r7', true );
wp_enqueue_script( 'superfish', get_template_directory_uri() . '/js/superfish.js', array( 'jquery' ), '1.7.5', true );
// Comment Reply
if ( is_singular() && comments_open() && get_option( 'thread_comments' ) ) {
wp_enqueue_script( 'comment-reply' );
}
// Keyboard image navigation support
if ( is_singular() && wp_attachment_is_image() ) {
wp_enqueue_script( 'wisteria-keyboard-image-navigation', get_template_directory_uri()<