Thank you Jarret!
The change to the parent theme’s content.php did force the excerpt. Bravo!
However, the code for the child theme’s function.php did not result in the Continue Reading button.
Is there another step needed? I have a few other code snippets in my function.php file. Not sure if that would affect the code you suggested. Posting my function.php code below in case it is useful for troubleshooting. Thank you again for you assistance!
<?php
add_action( 'wp_enqueue_scripts', 'my_theme_enqueue_styles' );
function my_theme_enqueue_styles() {
$parent_style = 'hemingway_style';
wp_enqueue_style( $parent_style, get_template_directory_uri() . '/style.css' );
wp_enqueue_style( 'child-style',
get_stylesheet_directory_uri() . '/style.css',
array( $parent_style ),
wp_get_theme()->get('Version')
);
}
// Redirect Registration Page
function my_registration_page_redirect()
{
global $pagenow;
if ( ( strtolower($pagenow) == 'wp-login.php') && ( strtolower( $_GET['action']) == 'register' ) ) {
wp_redirect( home_url('/registration'));
}
}
add_filter( 'init', 'my_registration_page_redirect' );
/**
* Format WordPress User's "Display Name" to Full Name on Login
* ------------------------------------------------------------------------------
*/
add_action( 'wp_login', 'wpse_9326315_format_user_display_name_on_login' );
function wpse_9326315_format_user_display_name_on_login( $username ) {
$user = get_user_by( 'login', $username );
$first_name = get_user_meta( $user->ID, 'first_name', true );
$last_name = get_user_meta( $user->ID, 'last_name', true );
$full_name = trim( $first_name . ' ' . $last_name );
if ( ! empty( $full_name ) && ( $user->data->display_name != $full_name ) ) {
$userdata = array(
'ID' => $user->ID,
'display_name' => $full_name,
);
wp_update_user( $userdata );
}
}
function wpsupport_excerpt_more( $more ) {
if ( ! is_single() ) {
$more = sprintf( '<p><a class="more-link" href="%1$s">%2$s</a></p>',
get_permalink( get_the_ID() ),
__( 'Continue Reading', 'textdomain' )
);
}
return $more;
}
add_filter( 'excerpt_more', 'wpsupport_excerpt_more' );
?>
-
This reply was modified 5 years, 12 months ago by
studio481.