Thank you, ThemeEverest, but the site in question already employs a number of plugins, and I do not want to add another, especially one as robust as a translation plugin, for what should be a simple code edit.
I was able to locate the text string “Posted on” in the template-tags.php file, located in the “inc” folder of the theme. I replicated the folder to my child theme and edited the relevant code. Unfortunately, and surprisingly, it did not work.
$posted_on = sprintf(
/* translators: %s: post date. */
esc_html_x( 'Posted on %s', 'post date', 'blogrid' ),
'<a href="' . esc_url( get_permalink() ) . '" rel="bookmark">' . $time_string . '</a>'
);
Luckily, a kind and diligent Redditor (u/PointsYak for the win!) helped me to figure out a solution. There’s a call in the parent functions.php file that always returns a path to the parent theme:
require get_template_directory() . '/inc/template-tags.php';
If one adds the following request to the functions.php file of child theme folder, the edited template-tags.php file of the child theme will start to have effect.
require get_stylesheet_directory() . '/inc/template-tags.php';
-
This reply was modified 4 years, 7 months ago by homemadejam. Reason: clarity
-
This reply was modified 4 years, 7 months ago by homemadejam.