Skip to content

Commit

Permalink
author template
Browse files Browse the repository at this point in the history
  • Loading branch information
seothemes committed Dec 24, 2023
1 parent f964a27 commit 5e12abf
Show file tree
Hide file tree
Showing 8 changed files with 49 additions and 3 deletions.
2 changes: 1 addition & 1 deletion assets/css/blocks/comments-title.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion assets/css/components/site-blocks.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions assets/svg/wordpress/circle-filled.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
15 changes: 15 additions & 0 deletions includes/blocks/paragraph.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
use function add_filter;
use function explode;
use function implode;
use function is_array;

add_filter( 'render_block_core/paragraph', NS . 'render_paragraph_block', 11, 2 );
/**
Expand Down Expand Up @@ -41,6 +42,20 @@ function render_paragraph_block( string $html, array $block ): string {
)
);

$p_styles = css_string_to_array( $p->getAttribute( 'style' ) );
$padding = $block['attrs']['style']['spacing']['padding'] ?? '';
$margin = $block['attrs']['style']['spacing']['margin'] ?? '';

if ( is_array( $padding ) && ! empty( $padding ) ) {
$p_styles = add_shorthand_property( $p_styles, 'padding', $padding );
}

if ( is_array( $margin ) && ! empty( $margin ) ) {
$p_styles = add_shorthand_property( $p_styles, 'margin', $margin );
}

$p->setAttribute( 'style', css_array_to_string( $p_styles ) );

$html = $dom->saveHTML();
$svg_string = $block['attrs']['curvedText']['svgString'] ?? '';

Expand Down
3 changes: 2 additions & 1 deletion includes/blocks/post-excerpt.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,11 @@
* @return string
*/
function render_post_excerpt( string $block_content, array $block, WP_Block $object ): string {
$query_id = $object->context['queryId'] ?? false;
$query_post_id = $object->context['postId'] ?? false;
$custom_excerpt = get_post_field( 'post_excerpt', $query_post_id ?? get_the_ID() );

if ( is_singular() && ! $custom_excerpt && ! $query_post_id ) {
if ( is_singular() && ! $custom_excerpt && ! $query_id ) {
return '';
}

Expand Down
10 changes: 10 additions & 0 deletions patterns/template/author.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<?php
/**
* Title: Template Author
* Slug: author
* Categories: template
* Template Types: archive
* Inserter: false
*/
?>
<!-- wp:pattern {"slug":"template-archive"} /-->
15 changes: 15 additions & 0 deletions src/scss/components/site-blocks.scss
Original file line number Diff line number Diff line change
Expand Up @@ -124,3 +124,18 @@ main {
.cursor-pointer {
cursor: pointer;
}

.fade-top {
mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0) 0%, rgb(0, 0, 0) 20%);
-webkit-mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0) 0%, rgb(0, 0, 0) 20%);
}

.fade-bottom {
mask-image: linear-gradient(to top, rgba(0, 0, 0, 0) 0%, rgb(0, 0, 0) 20%);
-webkit-mask-image: linear-gradient(to top, rgba(0, 0, 0, 0) 0%, rgb(0, 0, 0) 20%);
}

.fade-vertical {
mask-image: linear-gradient(to top, rgba(0, 0, 0, 0) 0%, rgb(0, 0, 0) 20%, rgb(0, 0, 0) 80%, rgba(0, 0, 0, 0) 100%);
-webkit-mask-image: linear-gradient(to top, rgba(0, 0, 0, 0) 0%, rgb(0, 0, 0) 20%, rgb(0, 0, 0) 80%, rgba(0, 0, 0, 0) 100%);
}
1 change: 1 addition & 0 deletions templates/author.html
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<!-- wp:pattern {"slug":"template-author"} /-->

0 comments on commit 5e12abf

Please sign in to comment.