Skip to content

Commit

Permalink
fixed #62
Browse files Browse the repository at this point in the history
  • Loading branch information
pfefferle committed Oct 5, 2018
1 parent b9f0c78 commit c618a67
Show file tree
Hide file tree
Showing 10 changed files with 34 additions and 43 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "SemPress",
"version": "1.5.10",
"version": "1.5.11",
"description": "SemPress is an extremely lightweight, responsive theme designed to show off your posts, quotes, and images. SemPress supports multiple post formats, widgets, and the option to upload a custom header or background image. The theme is based on HTML5 mixed with microformats, microformats v2 and microdata (Schema.org).",
"main": "Gruntfile.js",
"repository": {
Expand Down
6 changes: 4 additions & 2 deletions sass/_custom_post_formats.scss
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
/* Aside Posts */
.format-aside,
.format-status,
.format-link {
.entry-content {
.format-link,
.no-title {
.entry-content,
.entry-summary {
padding-top: 15px;
}
}
Expand Down
6 changes: 6 additions & 0 deletions sempress/content-page.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,17 @@
<h1 class="entry-title p-name" itemprop="name headline"><?php the_title(); ?></h1>
</header><!-- .entry-header -->

<?php if ( is_search() ) : // Only display Excerpts for Search ?>
<div class="entry-summary p-summary" itemprop="description">
<?php the_excerpt(); ?>
</div><!-- .entry-summary -->
<?php else : ?>
<?php sempress_the_post_thumbnail( '<div class="entry-media">', '</div>' ); ?>

<div class="entry-content e-content" itemprop="description text">
<?php the_content(); ?>
<?php wp_link_pages( array( 'before' => '<div class="page-link">' . __( 'Pages:', 'sempress' ), 'after' => '</div>' ) ); ?>
<?php edit_post_link( __( 'Edit', 'sempress' ), '<span class="edit-link">', '</span>' ); ?>
</div><!-- .entry-content -->
<?php endif; ?>
</article><!-- #post-<?php the_ID(); ?> -->
2 changes: 1 addition & 1 deletion sempress/entry-footer.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<footer class="entry-meta">
<?php
if ( in_array( get_post_format(), array( 'aside', 'link', 'status', 'quote' ) ) ) {
if ( in_array( get_post_format(), array( 'aside', 'link', 'status', 'quote' ) ) || ! get_the_title() ) {
sempress_posted_on();
} else {
_e( 'Posted', 'sempress' );
Expand Down
4 changes: 3 additions & 1 deletion sempress/entry-header.php
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
<?php if ( get_the_title() ) : ?>
<header class="entry-header">
<h1 class="entry-title p-name" itemprop="name headline"><a href="<?php the_permalink(); ?>" class="u-url url" title="<?php printf( esc_attr__( 'Permalink to %s', 'sempress' ), the_title_attribute( 'echo=0' ) ); ?>" rel="bookmark" itemprop="url"><?php the_title(); ?></a></h1>

<?php if ( 'post' == get_post_type() ) : ?>
<?php if ( 'post' === get_post_type() ) : ?>
<div class="entry-meta">
<?php sempress_posted_on(); ?>
</div><!-- .entry-meta -->
<?php endif; ?>
</header><!-- .entry-header -->
<?php endif; ?>
38 changes: 3 additions & 35 deletions sempress/functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,6 @@
* @since SemPress 1.0.0
*/

/**
* Set the content width based on the theme's design and stylesheet.
*/
if ( ! isset( $content_width ) ) {
$content_width = 670; /* pixels */
}

/**
* Set a default theme color array for WP.com.
*/
Expand Down Expand Up @@ -475,40 +468,15 @@ function sempress_the_post_thumbnail( $before = '', $after = '' ) {
* @since SemPress 1.3.0
*/
function sempress_content_width() {
global $content_width;
$content_width = 670; /* pixels */

if ( is_page_template( 'full-width-page.php' ) || is_attachment() || ! is_active_sidebar( 'sidebar-1' ) ) {
global $content_width;
$content_width = 880;
}

/*
if ( has_post_format( 'image' ) || has_post_format( 'video' ) || is_attachment() ) {
global $content_width;
$content_width = 668;
}
*/
}
add_action( 'template_redirect', 'sempress_content_width' );

/**
* replace post-title with id when empty
*
* @since SemPress 1.4.6
*
* @param string $title the post-title
* @param int $id the post-id
* @return string the filtered post-title
*/
function sempress_the_title( $title, $id = null ) {
// if title is empty, return the id
if ( empty( $title ) && ! empty( $id ) && ! is_feed() ) {
return "#$id";
}

return $title;
}
add_filter( 'the_title', 'sempress_the_title', 10, 2 );


/**
* Filter in a link to a content ID attribute for the next/previous image links on
* image attachment pages
Expand Down
4 changes: 4 additions & 0 deletions sempress/inc/semantics.php
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,10 @@ function sempress_body_classes( $classes ) {
function sempress_post_classes( $classes ) {
$classes = array_diff( $classes, array( 'hentry' ) );

if ( ! get_the_title() ) {
$classes[] = 'no-title';
}

if ( ! is_singular() ) {
return sempress_get_post_classes( $classes );
} else {
Expand Down
4 changes: 4 additions & 0 deletions sempress/readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,10 @@ The exceptions to this license are as follows:

== Changelog ==

= 1.5.11 =

* Support for titleless posts

= 1.5.10 =

* Fixed a lot of bugs
Expand Down
2 changes: 1 addition & 1 deletion sempress/search.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
<?php /* Start the Loop */ ?>
<?php while ( have_posts() ) : the_post(); ?>

<?php get_template_part( 'content', 'search' ); ?>
<?php get_template_part( 'content', get_post_format() ? get_post_format() : get_post_type() ); ?>

<?php endwhile; ?>

Expand Down
9 changes: 7 additions & 2 deletions sempress/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Theme URI: https://github.com/pfefferle/SemPress
Author: Matthias Pfefferle
Author URI: http://notiz.blog/projects/sempress/
Description: SemPress is an extremely lightweight, responsive theme designed to show off your posts, quotes, and images. SemPress supports multiple post formats, widgets, and the option to upload a custom header or background image. The theme is based on HTML5 mixed with microformats, microformats v2 and microdata (Schema.org).
Version: 1.5.10
Version: 1.5.11
License: GNU General Public License Version 3
License URI: http://www.gnu.org/licenses/gpl.html
Tags: custom-menu, custom-colors, custom-header, custom-background, custom-logo, sticky-post, microformats, rtl-language-support, translation-ready, full-width-template, post-formats, threaded-comments, right-sidebar, theme-options, two-columns, one-column, editor-style, featured-images, blog, news
Expand Down Expand Up @@ -702,8 +702,13 @@ body.single #content .post, body.single #content .page, body.page #content .post

/* Aside Posts */
.format-aside .entry-content,
.format-aside .entry-summary,
.format-status .entry-content,
.format-link .entry-content {
.format-status .entry-summary,
.format-link .entry-content,
.format-link .entry-summary,
.no-title .entry-content,
.no-title .entry-summary {
padding-top: 15px;
}

Expand Down

0 comments on commit c618a67

Please sign in to comment.