Skip to content

Commit

Permalink
Merge branch 'release/1.2.2'
Browse files Browse the repository at this point in the history
  • Loading branch information
GregLeBarbar committed Aug 30, 2018
2 parents 76cc3b1 + b827883 commit 70f4365
Show file tree
Hide file tree
Showing 21 changed files with 155 additions and 1,136 deletions.
12 changes: 12 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,18 @@

# CHANGELOG

*1.2.2* (2018-08-30)
- fix: Don't display homepage title on homepage
- Change behavior of teaser: activate excerpts
- fix: Hide h1 title when a hero shortcode is in a page content
- Add search icon in heading for copil
- Custom teasers implement card deck
- Add utility class as documented in elements
- fix: Remove y margin
- epfl-news: fix big image for news shortcode
- epfl-memento: fix div tag badly closed
- implement styleguide version (1.2.1)

*1.2.1* (2018-08-29)
- epfl-news: fix the width of highlighted template (fullscreen)
- faculties: increase faculty number to 10 fix
Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.2.1
1.2.2
2 changes: 1 addition & 1 deletion assets/css/base.css

Large diffs are not rendered by default.

302 changes: 0 additions & 302 deletions footer_mock_fr.php

This file was deleted.

32 changes: 28 additions & 4 deletions functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -206,13 +206,17 @@ function epfl_wp_class($classes) {
*/
function init_globals() {
global $containerClasses;
global $mainClasses;
$containerClasses = 'nav-toggle-layout nav-aside-layout';
$mainClasses = 'pt-5';

$actualTemplate = get_page_template_slug();
if (
$actualTemplate == 'page-aside-none.php'
|| $actualTemplate == 'page-homepage.php'
|| is_home()) {
$containerClasses = 'nav-toggle-layout';
$mainClasses = '';
}
}

Expand All @@ -236,16 +240,36 @@ function epfl_add_editor_styles() {
/**
* change excerpt length
*/
function custom_excerpt_length( $length ) {
return 40;
function custom_excerpt_length( $length = 0 ) {
return 55;
}
add_filter( 'excerpt_length', 'custom_excerpt_length' );
add_filter( 'excerpt_length', 'custom_excerpt_length', 9999 );

function excerpt_more( $more ) {
function excerpt_more( $more = '') {
return ' (...)';
}
add_filter( 'excerpt_more', 'excerpt_more' );

/**
* custom function for epfl excerpts. With a given post, returns a formatted excerpt.
* it will have the same behaviour whether it takes a user-defined excerpt or generates one from the content
* @arg $post a WP_Post object
*/
function epfl_excerpt($post = null) {
if(!$post) return '';
$excerpt = $post->post_excerpt;
if (strlen($excerpt) == 0) {
// custom excerpt is empty, let's generate one
$excerpt = strip_shortcodes($post->post_content);
$excerpt = str_replace(array("\r\n", "\r", "\n", " "), "", $excerpt);
$excerpt = wp_trim_words($excerpt, custom_excerpt_length(), excerpt_more());
} else {
// custom excerpt is set, let's trim it
$excerpt = wp_trim_words($excerpt, custom_excerpt_length(), excerpt_more());
}
return $excerpt;
}

/**
* Share icons directory with templates
*/
Expand Down
Loading

0 comments on commit 70f4365

Please sign in to comment.