Skip to content

Commit

Permalink
nicer Post-Kind design
Browse files Browse the repository at this point in the history
fix #78
  • Loading branch information
pfefferle committed Aug 12, 2020
1 parent b24a89a commit 6941ccf
Show file tree
Hide file tree
Showing 6 changed files with 47 additions and 23 deletions.
2 changes: 1 addition & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ services:
links:
- db
ports:
- "80:80"
- "8012:80"
volumes:
- ./sempress:/var/www/html/wp-content/themes/sempress
restart: always
Expand Down
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.6.0",
"version": "1.6.1",
"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
32 changes: 31 additions & 1 deletion sass/_integrations.scss
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,36 @@ ul.relsyn {
display: inline-block;
list-style: none;
margin-left: 5px;
vertical-align: middle;
}
}

.post-kind .entry-reaction {
line-height: 27px;
border-bottom: inset #D6D6D6;

.svg-icon {
display: block;
width: 45px;
height: 45px;
font-style: normal;
position: absolute;
left: -65px;
top: 25px;

svg {
fill: #555;
}
}

a {
color: #21759B;
}

header {
margin-bottom: 20px;
}
}

#page .post-kind img.avatar {
display: none;
}
24 changes: 7 additions & 17 deletions sempress/int/post-kinds.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,6 @@
* Removes native Post-Kinds implementation
*/
function sempress_post_kinds_init() {
if ( method_exists( 'Kind_Taxonomy', 'get_icon' ) ) {
add_filter( 'kind_icon_display', '__return_false', 10 );
}

remove_filter( 'the_content', array( 'Kind_View', 'content_response' ), 9 );
remove_filter( 'the_excerpt', array( 'Kind_View', 'excerpt_response' ), 9 );
remove_action( 'wp_enqueue_scripts', array( 'Post_Kinds_Plugin', 'style_load' ) );
Expand All @@ -35,21 +31,15 @@ function sempress_post_kinds_content() {
add_action( 'sempress_before_entry_content', 'sempress_post_kinds_content' );

/**
* Replace the Post-Format header with the Post-Kinds header
* Adds `post-kind` classes to the array of post classes.
*
* @param string $post_format_html Post-Format html
* @return string Post-Kind html
* @since SemPress 1.0.0
*/
function sempress_post_kinds_format( $post_format_html ) {
if ( ! get_post_kind_slug() ) {
return $post_format_html;
function sempress_post_kinds_post_classes( $classes = array() ) {
if ( Kind_View::get_display() ) {
$classes[] = 'post-kind';
}

$kind_slug = get_post_kind_slug();
$kind_icon = Kind_Taxonomy::get_icon( $kind_slug );
$kind_string = get_post_kind_string( $kind_slug );
$kind_link = esc_url( get_post_kind_link( get_post_kind() ) );

return sprintf( '<a class="kind kind-%s" href="%s">%s %s</a>', $kind_slug, $kind_link, $kind_icon, $kind_string );
return $classes;
}
add_filter( 'sempress_post_format', 'sempress_post_kinds_format' );
add_filter( 'post_class', 'sempress_post_kinds_post_classes', 99 );
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.6.1 =

* fixed Post-Kinds styling

= 1.6.0 =

* sidebar is no longer part of the `h-entry`
Expand Down
6 changes: 3 additions & 3 deletions sempress/style.css

Large diffs are not rendered by default.

0 comments on commit 6941ccf

Please sign in to comment.