- Timestamp:
- 10/16/2013 03:46:29 AM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-content/themes/twentyfourteen/functions.php
r25792 r25804 70 70 // Add several sizes for Post Thumbnails. 71 71 add_image_size( 'featured-thumbnail-large', 672, 0 ); 72 add_image_size( 'featured-thumbnail-featured', 672, 3 36, true );72 add_image_size( 'featured-thumbnail-featured', 672, 372, true ); 73 73 add_image_size( 'featured-thumbnail-formatted', 306, 0 ); 74 74 … … 253 253 } 254 254 add_action( 'admin_print_scripts-appearance_page_custom-header', 'twentyfourteen_admin_fonts' ); 255 256 /**257 * Set the post excerpt length to 20 words.258 *259 * @since Twenty Fourteen 1.0260 *261 * @param int $length262 * @return int263 */264 function twentyfourteen_excerpt_length( $length ) {265 return 20;266 }267 add_filter( 'excerpt_length', 'twentyfourteen_excerpt_length' );268 269 /**270 * Return a "Continue Reading" link for excerpts.271 *272 * @since Twenty Fourteen 1.0273 *274 * @return string275 */276 function twentyfourteen_continue_reading_link() {277 return ' <a href="'. esc_url( get_permalink() ) . '" class="more-link">' . __( 'Read More <span class="meta-nav">→</span>', 'twentyfourteen' ) . '</a>';278 }279 280 /**281 * Replace "[...]" (appended to automatically generated excerpts) with an282 * ellipsis and twentyfourteen_continue_reading_link().283 *284 * @since Twenty Fourteen 1.0285 *286 * @param string $more287 * @return string288 */289 function twentyfourteen_auto_excerpt_more( $more ) {290 return ' …' . twentyfourteen_continue_reading_link();291 }292 add_filter( 'excerpt_more', 'twentyfourteen_auto_excerpt_more' );293 294 /**295 * Add a pretty "Continue Reading" link to custom post excerpts.296 *297 * To override this link in a child theme, remove the filter and add your own298 * function tied to the get_the_excerpt filter hook.299 *300 * @since Twenty Fourteen 1.0301 *302 * @param string $output303 * @return string304 */305 function twentyfourteen_custom_excerpt_more( $output ) {306 if ( has_excerpt() && ! is_attachment() ) {307 $output .= twentyfourteen_continue_reading_link();308 }309 return $output;310 }311 add_filter( 'get_the_excerpt', 'twentyfourteen_custom_excerpt_more' );312 255 313 256 if ( ! function_exists( 'twentyfourteen_the_attached_image' ) ) :
Note: See TracChangeset
for help on using the changeset viewer.