Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 11 additions & 2 deletions content-page.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,19 @@
* @package Masonry
*/
?>

<?php $masonry_options = get_option( 'masonry_theme_options' ); ?>
<article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
<header class="entry-header">
<?php the_title( '<h1 class="entry-title">', '</h1>' ); ?>
<?php
$class = 'entry-title';

/* show title ( default -> hide homepage title checkbox is unchecked ) */
if( ( is_home() || is_front_page() ) && ! empty( $masonry_options['hide_homepage_title'] ) ) {
$class .= ' hidden';
}

the_title( '<h1 class="'.$class.'">', '</h1>' );
?>
</header><!-- .entry-header -->

<div class="entry-content">
Expand Down
8 changes: 7 additions & 1 deletion content-search.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,13 @@

<?php if ( 'post' == get_post_type() ) : ?>
<div class="entry-meta">
<?php masonry_posted_on(); ?>
<?php
if( ! empty( $masonry_options['last_updated_on'] ) ){
masonry_last_updated_on();
} else{
masonry_posted_on();
}
?>
</div><!-- .entry-meta -->
<?php endif; ?>
</header><!-- .entry-header -->
Expand Down
46 changes: 26 additions & 20 deletions content-single.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,35 +3,41 @@
* @package Masonry
*/
?>

<?php $masonry_options = get_option( 'masonry_theme_options' ); ?>
<article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>


<?php if ( has_post_thumbnail() ) : ?>
<div class="entry-thumbnail">
<?php the_post_thumbnail( 'masonry-single' ); ?>
</div><!-- .entry-thumbnail -->
<?php endif; ?>

<header class="entry-header">
<?php the_title( '<h1 class="entry-title">', '</h1>' ); ?>

<div class="entry-meta">
<?php masonry_posted_on(); ?>
<?php
if( ! empty( $masonry_options['last_updated_on'] ) ){
masonry_last_updated_on();
} else{
masonry_posted_on();
}
?>
</div><!-- .entry-meta -->
</header><!-- .entry-header -->

<?php if ( has_post_thumbnail() ) : ?>
<div class="entry-thumbnail">
<?php the_post_thumbnail( 'masonry-single' ); ?>
</div><!-- .entry-thumbnail -->
<?php endif; ?>

<div class="entry-content">
<?php the_content(); ?>
<?php
wp_link_pages( array(
'before' => '<div class="page-links">' . __( 'Pages:', 'masonry' ),
'after' => '</div>',
wp_link_pages( array(
'before' => '<div class="page-links">' . __( 'Pages:', 'masonry' ),
'after' => '</div>',
) );
?>
</div><!-- .entry-content -->
?>
</div><!-- .entry-content -->

<footer class="entry-footer">
<?php
<footer class="entry-footer">
<?php
/* translators: used between list items, there is a space after the comma */
$category_list = get_the_category_list( __( ', ', 'masonry' ) );

Expand Down Expand Up @@ -61,9 +67,9 @@
$category_list,
$tag_list,
get_permalink()
);
?>
);
?>

<?php edit_post_link( __( 'Edit', 'masonry' ), '<span class="edit-link">', '</span>' ); ?>
</footer><!-- .entry-footer -->
<?php edit_post_link( __( 'Edit', 'masonry' ), '<span class="edit-link">', '</span>' ); ?>
</footer><!-- .entry-footer -->
</article><!-- #post-## -->
114 changes: 61 additions & 53 deletions content.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,83 +3,91 @@
* @package Masonry
*/
?>

<?php $masonry_options = get_option( 'masonry_theme_options' ); ?>
<article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>

<?php if ( has_post_thumbnail() ) : ?>
<div class="entry-thumbnail">
<a href="<?php the_permalink(); ?>" rel="bookmark">
<header class="entry-header header-hover">
<?php
$title = the_title('<h1 class="entry-title">', '</h1>' ,false);
if(strlen($title) > 60):
echo trim(substr($title, 0, 100)).'...';

<div class="entry-thumbnail">
<a class="thumbnail" href="<?php the_permalink(); ?>" rel="bookmark" >
<?php the_post_thumbnail( 'masonry-home' ); ?>
</a>

</div><!-- .entry-thumbnail -->
<div class="entry-thumbnail-title">
<?php
$title = the_title('', '' ,false);
if(strlen($title) > 50):
echo trim(substr($title, 0, 50)).'...';
else:
echo $title;
endif;
?>
</header>
<?php the_post_thumbnail( 'masonry-home' ); ?>
</a>
</div><!-- .entry-thumbnail -->
<?php else: ?>

<header class="entry-header">
<?php the_title( sprintf( '<h1 class="entry-title"><a href="%s" rel="bookmark">', esc_url( get_permalink() ) ), '</a></h1>' ); ?>

<?php if ( 'post' == get_post_type() ) : ?>
<div class="entry-meta">
<?php masonry_posted_on(); ?>
</div><!-- .entry-meta -->
<?php endif; ?>
</header><!-- .entry-header -->
?>
</div>
<?php else: ?>

<header class="entry-header">
<?php the_title( sprintf( '<h1 class="entry-title"><a href="%s" rel="bookmark">', esc_url( get_permalink() ) ), '</a></h1>' ); ?>

<div class="entry-content">
<?php if ( 'post' == get_post_type() ) : ?>
<div class="entry-meta">
<?php
if ( is_home() ) {
// For home.php only
the_excerpt();
} else {
// When not home.php
the_content( __( 'Continue reading <span class="meta-nav">&rarr;</span>', 'masonry' ) );
if( ! empty( $masonry_options['last_updated_on'] ) ){
masonry_last_updated_on();
} else{
masonry_posted_on();
}
?>
<?php
</div><!-- .entry-meta -->
<?php endif; ?>
</header><!-- .entry-header -->

<div class="entry-content">
<?php
if ( is_home() ) {
// For home.php only
the_excerpt();
} else {
// When not home.php
the_content( __( 'Continue reading <span class="meta-nav">&rarr;</span>', 'masonry' ) );
}
?>
<?php
wp_link_pages( array(
'before' => '<div class="page-links">' . __( 'Pages:', 'masonry' ),
'after' => '</div>',
) );
?>
</div><!-- .entry-content -->
) );
?>
</div><!-- .entry-content -->

<footer class="entry-footer">
<?php if ( 'post' == get_post_type() ) : // Hide category and tag text for pages on Search ?>
<?php
/* translators: used between list items, there is a space after the comma */
$categories_list = get_the_category_list( __( ', ', 'masonry' ) );
if ( $categories_list && masonry_categorized_blog() ) :
?>
<span class="cat-links">
<?php printf( __( 'Posted in %1$s', 'masonry' ), $categories_list ); ?>
</span>
<?php endif; // End if categories ?>
<footer class="entry-footer">
<?php if ( 'post' == get_post_type() ) : // Hide category and tag text for pages on Search ?>
<?php
/* translators: used between list items, there is a space after the comma */
$categories_list = get_the_category_list( __( ', ', 'masonry' ) );
if ( $categories_list && masonry_categorized_blog() ) :
?>
<span class="cat-links">
<?php printf( __( 'Posted in %1$s', 'masonry' ), $categories_list ); ?>
</span>
<?php endif; // End if categories ?>

<?php
<?php
/* translators: used between list items, there is a space after the comma */
$tags_list = get_the_tag_list( '', __( ', ', 'masonry' ) );
if ( $tags_list ) :
?>
<span class="tags-links">
<?php printf( __( 'Tagged %1$s', 'masonry' ), $tags_list ); ?>
</span>
?>
<span class="tags-links">
<?php printf( __( 'Tagged %1$s', 'masonry' ), $tags_list ); ?>
</span>
<?php endif; // End if $tags_list ?>
<?php endif; // End if 'post' == get_post_type() ?>

<?php if ( ! post_password_required() && ( comments_open() || '0' != get_comments_number() ) ) : ?>
<span class="comments-link"><?php comments_popup_link( __( 'Leave a comment', 'masonry' ), __( '1 Comment', 'masonry' ), __( '% Comments', 'masonry' ) ); ?></span>
<span class="comments-link"><?php comments_popup_link( __( 'Leave a comment', 'masonry' ), __( '1 Comment', 'masonry' ), __( '% Comments', 'masonry' ) ); ?></span>
<?php endif; ?>

<?php edit_post_link( __( 'Edit', 'masonry' ), '<span class="edit-link">', '</span>' ); ?>
</footer><!-- .entry-footer -->
<?php endif; ?>
<?php endif; ?>
</article><!-- #post-## -->
2 changes: 1 addition & 1 deletion fonts/LICENCE.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Copyright (c) 2014, Stephen Hutchings (http://www.s-ings.com/).

This Font Software is licensed under the SIL Open Font License, Version 1.1.
This Font Software is licensed under the SIL Open Font License, Version 1.2.

This license is copied below, and is also available with a FAQ at: http://scripts.sil.org/OFL

Expand Down
2 changes: 1 addition & 1 deletion footer.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
<?php endif; ?>

<div class="site-credits">
<?php printf( __( 'Theme: %1$s by %2$s.', 'masonry' ), 'Masonry', '<a href="http://devrix.com/themes/masonry/" title="Masonry WordPress Theme" rel="designer">DevriX</a>' ); ?>
<?php printf( __( 'Theme: %1$s by %2$s.', 'masonry' ), 'Masonry', '<a esc_url( href="http://devrix.com/themes/masonry/ )" title="Masonry WordPress Theme" rel="designer">DevriX</a>' ); ?>
<a href="<?php echo esc_url( __( 'http://wordpress.org/', 'masonry' ) ); ?>"><?php printf( __( 'Proudly powered by %s', 'masonry' ), 'WordPress' ); ?></a>
</div><!-- .site-credits -->

Expand Down
32 changes: 26 additions & 6 deletions functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,6 @@ function masonry_setup() {
// Add default posts and comments RSS feed links to head.
add_theme_support( 'automatic-feed-links' );

/**
* This feature allows themes to add document title tag to HTML <head>.
* @see https://codex.wordpress.org/Title_Tag
*/
add_theme_support( 'title-tag' );

/*
* Enable support for Post Thumbnails on posts and pages.
*
Expand All @@ -52,6 +46,22 @@ function masonry_setup() {
add_image_size( 'masonry-home', '300', '300', true ) /* Home only */;
add_image_size( 'masonry-single', '960', '9999', false ) /* Single pages */ ;

/*
* Change medium image croping to hardcrop
*/
if(false === get_option("medium_crop")) {
add_option("medium_crop", "1");
}
else {
update_option("medium_crop", "1");
}


/**
* This feature allows themes to add document title tag to HTML <head>.
* @see https://codex.wordpress.org/Title_Tag
*/
add_theme_support( 'title-tag' );

// This theme uses wp_nav_menu() in one location.
register_nav_menus( array(
Expand All @@ -77,6 +87,7 @@ function masonry_setup() {
endif; // masonry_setup
add_action( 'after_setup_theme', 'masonry_setup' );


/**
* Register widget area.
*
Expand Down Expand Up @@ -121,6 +132,15 @@ function masonry_scripts() {
if ( is_singular() && comments_open() && get_option( 'thread_comments' ) ) {
wp_enqueue_script( 'comment-reply' );
}

$masonry_options = get_option( 'masonry_theme_options' );
$excerpt_val = !empty( $masonry_options['display_excerpt'] ) ? $masonry_options['display_excerpt'] : "";
$excerpt_array = array(
'excerpt' => $excerpt_val
);
wp_localize_script( 'masonry-helpers', 'display_excerpt_val', $excerpt_array );


}
add_action( 'wp_enqueue_scripts', 'masonry_scripts' );

Expand Down
20 changes: 10 additions & 10 deletions header.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,11 @@
<div id="page" class="hfeed site">
<a class="skip-link screen-reader-text" href="#content"><?php _e( 'Skip to content', 'masonry' ); ?></a>

<header id="masthead" class="site-header" role="banner">
<?php if ( get_header_image() ) : ?>
<header id="masthead" class="site-header" role="banner" style="background-image: url('<?php header_image(); ?>')">
<?php else : ?>
<header id="masthead" class="site-header" role="banner">
<?php endif; // End header image check. ?>

<div class="site-banner">

Expand All @@ -43,9 +47,9 @@
<?php endif; ?>

</div>
<a href="#sidr-main" class="navigation-button">
<span class="icon"><span class="menu-text"><?php _e( 'Menu', 'masonry' ); ?></span><span>
<a id="simple-menu" class="menu-button" href="#sidr">
<span class="icon"><span class="menu-text"><?php _e( 'Menu', 'masonry' ); ?></span><span>
</a>

<nav id="site-navigation" class="main-navigation" role="navigation">
Expand All @@ -58,13 +62,9 @@
</nav><!-- #site-navigation -->

</div><!-- .site-banner -->

<div class="header-overlay"></div><!-- .header-overlay -->
</header><!-- #masthead -->

<?php if ( get_header_image() ) : ?>
<div class="header-image-overlay">
<div class="site-header-image" style="background-image: url('<?php header_image(); ?>')"></div>
</div><!-- .header-image-overlay -->
<?php endif; // End header image check. ?>


<div id="content" class="site-content">
Binary file modified images/default-image.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading