Skip to content

Commit

Permalink
First commit, theme as it exists on the server today
Browse files Browse the repository at this point in the history
  • Loading branch information
leodh committed Jul 19, 2015
0 parents commit 5be3e4f
Show file tree
Hide file tree
Showing 12 changed files with 686 additions and 0 deletions.
Empty file added LICENSE.md
Empty file.
Empty file added README.md
Empty file.
63 changes: 63 additions & 0 deletions category.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
<?php
/**
* The template for displaying Category pages
*
* Used to display archive-type pages for posts in a category.
*
* @link http://codex.wordpress.org/Template_Hierarchy
*
* @package WordPress
* @subpackage Twenty_Twelve
* @since Twenty Twelve 1.0
*/

get_header(); ?>

<section id="primary" class="site-content">
<div id="content" role="main">

<?php if ( have_posts() ) : ?>
<header class="archive-header">
<h1 class="archive-title"><?php printf( __( '%s', 'twentytwelve' ), '<span>' . single_cat_title( '', false ) . '</span>' ); ?></h1>

<?php if ( category_description() ) : // Show an optional category description ?>
<div class="archive-meta"><?php echo category_description(); ?>
<?php endif; ?>

<?php $my_query = new WP_Query( 'cat=' . $cat . '&posts_per_page=-1' );?>
<div class="archive-dropdown-container">
<select name="archive-dropdown" onchange='document.location.href=value;'>
<?php while ( $my_query->have_posts() ) : $my_query->the_post(); ?>
<option value="<?php echo get_the_permalink();?>"><?php echo get_the_title(); ?></option>
<?php endwhile; ?>
</select>
</div><!-- .archive-dropdown-container -->
</div><!-- .archive-meta -->
</header><!-- .archive-header -->

<?php /* rewind_posts(); */?>

<?php
/* Start the Loop */
while ( have_posts() ) : the_post();

/* Include the post format-specific template for the content. If you want to
* this in a child theme then include a file called called content-___.php
* (where ___ is the post format) and that will be used instead.
*/
get_template_part( 'content', get_post_format() );

endwhile;

twentytwelve_content_nav( 'nav-below' );
?>

<?php else : ?>
<?php get_template_part( 'content', 'none' ); ?>
<?php endif; ?>

</div><!-- #content -->
</section><!-- #primary -->

<?php get_sidebar(); ?>
<?php get_footer(); ?>
92 changes: 92 additions & 0 deletions contact.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
<?php
/* Template Name: Contact Us */
get_header(); ?>

<div id="primary" class="site-content">
<div id="content" role="main">

<?php while ( have_posts() ) : the_post(); ?>
<article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
<header class="entry-header">
<?php if ( ! is_page_template( 'page-templates/front-page.php' ) ) : ?>
<?php the_post_thumbnail(); ?>
<?php endif; ?>
<h1 class="entry-title"><?php the_title(); ?></h1>
</header>

<div class="entry-content">

<?php
if(isset($_POST['submit_subscribe']))
{
$flag=1;

if($_POST['email_subscribe']=='')
{
$flag=0;
echo "<font color='#FF0000'>Veuillez fournir une adresse mail.</font><br>";
}
else if(!eregi("^[_a-z0-9-]+(.[_a-z0-9-]+)*@[a-z0-9-]+(.[a-z0-9-]+)*(.[a-z]{2,3})$", $_POST['email_subscribe']))
{
$flag=0;
echo "<font color='#FF0000'>Veuillez fournir une adresse mail valide.</font><br>";
}
if($flag==1)
{
$ccclipper="[email protected]";
$mail=trim($_POST[email_subscribe]);
$subject="add [email protected] ".$mail;

wp_mail($ccclipper, $subject," ") or die ("L'e-mail n'a pas pu être envoyé. Veuillez essayer.");
echo "<font color='#0000A0'>La demande d'inscription a bien été prise en compte.</font>";
}
}

?>

<?php
if(isset($_POST['submit_unsubscribe']))
{
$flag=1;

if($_POST['email_unsubscribe']=='')
{
$flag=0;
echo "<font color='#FF0000'>Veuillez fournir une adresse mail.</font><br>";
}
else if(!eregi("^[_a-z0-9-]+(.[_a-z0-9-]+)*@[a-z0-9-]+(.[a-z0-9-]+)*(.[a-z]{2,3})$", $_POST['email_unsubscribe']))
{
$flag=0;
echo "<font color='#FF0000'>Veuillez fournir une adresse mail valide.</font><br>";
}
if($flag==1)
{
$ccclipper="[email protected]";
$mail=trim($_POST[email_unsubscribe]);
$subject="del [email protected] ".$mail;

wp_mail($ccclipper, $subject," ") or die ("<font color='#FF0000'>L'e-mail n'a pas pu être envoyé. Veuillez essayer.</font>");
echo "<font color='#0000A0'>La demande de désinscription a bien été prise en compte.</font>";
}
}

?>

<?php the_content(); ?>

<?php wp_link_pages( array( 'before' => '<div class="page-links">' . __( 'Pages:', 'twentytwelve' ), 'after' => '</div>' ) ); ?>
</div><!-- .entry-content -->
<footer class="entry-meta">
<?php edit_post_link( __( 'Edit', 'twentytwelve' ), '<span class="edit-link">', '</span>' ); ?>
</footer><!-- .entry-meta -->
</article><!-- #post -->


<?php endwhile; // end of the loop. ?>

</div><!-- #content -->
</div><!-- #primary -->

<?php get_sidebar(); ?>
<?php get_footer(); ?>

73 changes: 73 additions & 0 deletions content.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
<?php
/**
* The default template for displaying content
*
* Used for both single and index/archive/search.
*
* @package WordPress
* @subpackage Twenty_Twelve
* @since Twenty Twelve 1.0
*/
?>

<article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
<?php if ( is_sticky() && is_home() && ! is_paged() ) : ?>
<div class="featured-post">
<?php _e( 'Featured post', 'twentytwelve' ); ?>
</div>
<?php endif; ?>
<header class="entry-header">
<?php if ( ! post_password_required() && ! is_attachment() ) :
the_post_thumbnail();
endif; ?>

<?php if ( is_single() ) : ?>
<h1 class="entry-title"><?php the_title(); ?></h1>
<?php else : ?>
<h1 class="entry-title">
<a href="<?php the_permalink(); ?>" rel="bookmark"><?php the_title(); ?></a>
</h1>
<?php endif; // is_single() ?>
</header><!-- .entry-header -->

<?php if ( is_search() ) : // Only display Excerpts for Search ?>
<div class="entry-summary">
<?php the_excerpt(); ?>
</div><!-- .entry-summary -->
<?php else : ?>
<div class="entry-content">
<?php the_content( __( 'Continue reading <span class="meta-nav">&rarr;</span>', 'twentytwelve' ) ); ?>
<?php wp_link_pages( array( 'before' => '<div class="page-links">' . __( 'Pages:', 'twentytwelve' ), 'after' => '</div>' ) ); ?>
</div><!-- .entry-content -->
<?php endif; ?>

<footer class="entry-meta">
<?php twentytwelve_entry_meta(); ?>
<?php edit_post_link( __( 'Edit', 'twentytwelve' ), '<span class="edit-link">', '</span>' ); ?>
<?php if ( is_singular() && get_the_author_meta( 'description' ) && is_multi_author() ) : // If a user has filled out their description and this is a multi-author blog, show a bio on their entries. ?>
<div class="author-info">
<div class="author-avatar">
<?php
/** This filter is documented in author.php */
$author_bio_avatar_size = apply_filters( 'twentytwelve_author_bio_avatar_size', 68 );
echo get_avatar( get_the_author_meta( 'user_email' ), $author_bio_avatar_size );
?>
</div><!-- .author-avatar -->
<div class="author-description">
<h2><?php printf( __( 'About %s', 'twentytwelve' ), get_the_author() ); ?></h2>
<p><?php the_author_meta( 'description' ); ?></p>
<div class="author-link">
<a href="<?php echo esc_url( get_author_posts_url( get_the_author_meta( 'ID' ) ) ); ?>" rel="author">
<?php printf( __( 'View all posts by %s <span class="meta-nav">&rarr;</span>', 'twentytwelve' ), get_the_author() ); ?>
</a>
</div><!-- .author-link -->
</div><!-- .author-description -->
</div><!-- .author-info -->
<?php endif; ?>
<?php if ( comments_open() ) : ?>
<div class="comments-link">
<?php comments_popup_link( '<span class="leave-reply">' . __( 'Leave a reply', 'twentytwelve' ) . '</span>', __( '1 Reply', 'twentytwelve' ), __( '% Replies', 'twentytwelve' ) ); ?>
</div><!-- .comments-link -->
<?php endif; // comments_open() ?>
</footer><!-- .entry-meta -->
</article><!-- #post -->
9 changes: 9 additions & 0 deletions count-post-category.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<?php
/* Variables handling the number of posts displayed on 'category' pages */

$partenariats=1;
$cannes2014=3;
$critiques=3;
$analyses=2;
$seances=1;
?>
66 changes: 66 additions & 0 deletions functions.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
<?php

include "count-post-category.php";
add_action('pre_get_posts', 'diff_post_count_per_cat');

function diff_post_count_per_cat() {
if (is_admin()) return;

include 'count-post-category.php';

$cat = get_query_var('category_name');
switch ($cat) {
case 'partenariats':
set_query_var('posts_per_page',$partenariats);
break;
case 'cannes-2014':
set_query_var('posts_per_page',$cannes2014);
break;
case 'critiques':
set_query_var('posts_per_page',$critiques);
break;
case 'analyses':
set_query_var('posts_per_page',$analyses);
break;
case 'seances':
set_query_var('posts_per_page',$seances);
break;
}
}

function get_categories_dropdown() {
$return_text="<div class=\"nav-dropdown-categories\"><center><h3>Archives des catégories de l'article</h3></center><br />";

$post_categories = wp_get_post_categories( get_the_ID() );

foreach($post_categories as $cat){

$my_query = new WP_Query( 'cat=' . $cat . '&posts_per_page=-1' );
$return_text.="<h4><a href=\"".get_category_link($cat)."\">".get_cat_name($cat)."</a></h4><br />";
$return_text.="<div class=\"archive-dropdown-container\"><select name=\"archive-dropdown\" onchange='document.location.href=value;'>";

while ( $my_query->have_posts() ) : $my_query->the_post();
$the_permalink=get_the_permalink();
$the_title=get_the_title();
$return_text .="<option value=\"$the_permalink\">$the_title</option>";
endwhile;
$return_text.="</select></div><!-- .archive-dropdown-container --><br />";
wp_reset_postdata();

}

$return_text.="</div><!-- .nav-dropdown-categories -->";
echo $return_text;
}
/*
function get_nav_single() {
<nav class="nav-single">
<h3 class="assistive-text"><?php _e( 'Post navigation', 'twentytwelve' ); ?></h3>
<span class="nav-previous"><?php previous_post_link( '%link', '<span class="meta-nav">' . _x( '&larr;', 'Previous post link', 'twentytwelve' ) . '</span> %title', TRUE); ?></span>
<span class="nav-next"><?php next_post_link( '%link', '%title <span class="meta-nav">' . _x( '&rarr;', 'Next post link', 'twentytwelve' ) . '</span>', TRUE ); ?></span>
</nav><!-- .nav-single -->
}
*/
?>
56 changes: 56 additions & 0 deletions header.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
<?php
/**
* The Header template for our theme
*
* Displays all of the <head> section and everything up till <div id="main">
*
* @package WordPress
* @subpackage Twenty_Twelve
* @since Twenty Twelve 1.0
*/
?><!DOCTYPE html>
<!--[if IE 7]>
<html class="ie ie7" <?php language_attributes(); ?>>
<![endif]-->
<!--[if IE 8]>
<html class="ie ie8" <?php language_attributes(); ?>>
<![endif]-->
<!--[if !(IE 7) | !(IE 8) ]><!-->
<html <?php language_attributes(); ?>>
<!--<![endif]-->
<head>
<meta charset="<?php bloginfo( 'charset' ); ?>" />
<meta name="viewport" content="width=device-width" />
<title><?php wp_title( '|', true, 'right' ); ?></title>
<link rel="profile" href="http://gmpg.org/xfn/11" />
<link rel="pingback" href="<?php bloginfo( 'pingback_url' ); ?>" />
<?php // Loads HTML5 JavaScript file to add support for HTML5 elements in older IE versions. ?>
<!--[if lt IE 9]>
<script src="<?php echo get_template_directory_uri(); ?>/js/html5.js" type="text/javascript"></script>
<![endif]-->
<?php wp_head(); ?>
<link rel="shortcut icon" href="http://www.cineclub.ens.fr/wp-content/uploads/2014/09/favicon.ico" />
</head>

<body <?php body_class(); ?>>
<div id="page" class="hfeed site">
<header id="masthead" class="site-header" role="banner">

<?php if ( get_header_image() ) : ?>
<a href="<?php echo esc_url( home_url( '/' ) ); ?>"><img src="<?php header_image(); ?>" class="header-image" width="<?php echo get_custom_header()->width; ?>" height="<?php echo get_custom_header()->height; ?>" alt="" /></a>
<?php endif; ?>

<hgroup>
<h1 class="site-title"><a href="<?php echo esc_url( home_url( '/' ) ); ?>" title="<?php echo esc_attr( get_bloginfo( 'name', 'display' ) ); ?>" rel="home"><?php bloginfo( 'name' ); ?></a></h1>
<h2 class="site-description"><?php bloginfo( 'description' ); ?></h2>
</hgroup>

<nav id="site-navigation" class="main-navigation" role="navigation">
<h3 class="menu-toggle"><?php _e( 'Menu', 'twentytwelve' ); ?></h3>
<a class="assistive-text" href="#content" title="<?php esc_attr_e( 'Skip to content', 'twentytwelve' ); ?>"><?php _e( 'Skip to content', 'twentytwelve' ); ?></a>
<?php wp_nav_menu( array( 'theme_location' => 'primary', 'menu_class' => 'nav-menu' ) ); ?>
</nav><!-- #site-navigation -->

</header><!-- #masthead -->

<div id="main" class="wrapper">
Loading

0 comments on commit 5be3e4f

Please sign in to comment.