Browse Source

changes to the excerpt filter and styles

Maggie Cabrera 4 năm trước cách đây
mục cha
commit
042baaffda

+ 25 - 0
spearhead/assets/sass/_posts-and-pages.scss

@@ -49,3 +49,28 @@
 .sticky-post {
 .sticky-post {
 	display: none;
 	display: none;
 }
 }
+
+.entry-content {
+    .more-link {
+        margin-top: 0;
+        margin-left: 0.5rem;
+        display: inline-block;
+        color: var(--global--color-foreground);
+        font-size: calc(0.75 * var(--global--font-size-base));
+        &:hover {
+            border: none;
+            color: var(--global--color-primary);
+        }
+        &:after {
+            content: none;
+        }
+        svg {
+            height: var(--global--font-size-base);
+            width: var(--global--font-size-base);
+            margin-left: -0.25em;
+            display: inline-block;
+            vertical-align: middle;
+            transform: rotate(-90deg);
+        }
+    }
+}

+ 24 - 0
spearhead/functions.php

@@ -96,6 +96,8 @@ if ( ! function_exists( 'spearhead_setup' ) ) :
 				),
 				),
 			)
 			)
 		);
 		);
+		remove_filter( 'excerpt_more', 'seedlet_continue_reading_link' );
+		remove_filter( 'the_content_more_link', 'seedlet_continue_reading_link' );
 	}
 	}
 endif;
 endif;
 add_action( 'after_setup_theme', 'spearhead_setup', 12 );
 add_action( 'after_setup_theme', 'spearhead_setup', 12 );
@@ -192,3 +194,25 @@ add_filter(
 		return $classes;
 		return $classes;
 	}
 	}
 );
 );
+
+/*
+ * Create the continue reading link
+ */
+function spearhead_continue_reading_link() {
+
+	if ( ! is_admin() ) {
+		$continue_reading = sprintf(
+			/* translators: %s: Name of current post. */
+			wp_kses( __( 'More %s', 'seedlet' ), array( 'span' => array( 'class' => array() ) ) ),
+			the_title( '<span class="screen-reader-text">"', '"</span>', false )
+		);
+
+		return '<a class="more-link" href="' . esc_url( get_permalink() ) . '">' . $continue_reading . ' ' . seedlet_get_icon_svg( 'dropdown' ) . '</a>';
+	}
+}
+
+// Filter the excerpt more link
+add_filter( 'excerpt_more', 'spearhead_continue_reading_link' );
+
+// Filter the content more link
+add_filter( 'the_content_more_link', 'spearhead_continue_reading_link' );

+ 26 - 0
spearhead/style-rtl.css

@@ -83,6 +83,32 @@ Tags: one-column, flexible-header, accessibility-ready, custom-colors, custom-me
 	display: none;
 	display: none;
 }
 }
 
 
+.entry-content .more-link {
+	margin-top: 0;
+	margin-right: 0.5rem;
+	display: inline-block;
+	color: var(--global--color-foreground);
+	font-size: calc(0.75 * var(--global--font-size-base));
+}
+
+.entry-content .more-link:hover {
+	border: none;
+	color: var(--global--color-primary);
+}
+
+.entry-content .more-link:after {
+	content: none;
+}
+
+.entry-content .more-link svg {
+	height: var(--global--font-size-base);
+	width: var(--global--font-size-base);
+	margin-right: -0.25em;
+	display: inline-block;
+	vertical-align: middle;
+	transform: rotate(90deg);
+}
+
 .has-link-color a, a {
 .has-link-color a, a {
 	border-bottom: 1px solid transparent;
 	border-bottom: 1px solid transparent;
 	transition: all 0.1s ease;
 	transition: all 0.1s ease;

+ 26 - 0
spearhead/style.css

@@ -83,6 +83,32 @@ Tags: one-column, flexible-header, accessibility-ready, custom-colors, custom-me
 	display: none;
 	display: none;
 }
 }
 
 
+.entry-content .more-link {
+	margin-top: 0;
+	margin-left: 0.5rem;
+	display: inline-block;
+	color: var(--global--color-foreground);
+	font-size: calc(0.75 * var(--global--font-size-base));
+}
+
+.entry-content .more-link:hover {
+	border: none;
+	color: var(--global--color-primary);
+}
+
+.entry-content .more-link:after {
+	content: none;
+}
+
+.entry-content .more-link svg {
+	height: var(--global--font-size-base);
+	width: var(--global--font-size-base);
+	margin-left: -0.25em;
+	display: inline-block;
+	vertical-align: middle;
+	transform: rotate(-90deg);
+}
+
 .has-link-color a, a {
 .has-link-color a, a {
 	border-bottom: 1px solid transparent;
 	border-bottom: 1px solid transparent;
 	transition: all 0.1s ease;
 	transition: all 0.1s ease;

Những thai đổi đã bị hủy bỏ vì nó quá lớn
+ 0 - 0
spearhead/style.css.map


+ 29 - 0
spearhead/template-parts/content/content-excerpt.php

@@ -0,0 +1,29 @@
+<?php
+/**
+ * Template part for displaying post archives and search results
+ *
+ * @link https://developer.wordpress.org/themes/basics/template-hierarchy/
+ *
+ * @package Seedlet
+ * @since 1.0.0
+ */
+
+?>
+
+<article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
+	<header class="entry-header default-max-width">
+		<?php
+		if ( is_sticky() && is_home() && ! is_paged() ) {
+			printf( '<span class="sticky-post">%s</span>', _x( 'Featured', 'post', 'seedlet' ) );
+		}
+		the_title( sprintf( '<h2 class="entry-title"><a href="%s" rel="bookmark">', esc_url( get_permalink() ) ), '</a></h2>' );
+		?>
+	</header><!-- .entry-header -->
+
+	<?php seedlet_post_thumbnail(); ?>
+
+	<div class="entry-content">
+		<?php the_excerpt(); ?>
+	</div><!-- .entry-content -->
+
+</article><!-- #post-${ID} -->

Một số tệp đã không được hiển thị bởi vì quá nhiều tập tin thay đổi trong này khác