Older post Newer Post text

Hello, I have created a child theme of Perth Pro and made some changes. I would also like to change the text on the navigations buttons OLDER POST NEWER POSTS for something else that I can copy on the functions.php file of my child.

I am not too sure where to get the original function to modify it, any help would be greatly appreciated.

Cheers

Hi,

You can modify the pagination text in inc / template-tags.php from line 26, in this code:

<?php if ( get_next_posts_link() ) : ?>
			<div class="nav-previous"><?php next_posts_link( __( 'Older posts', 'perth' ) ); ?></div>
			<?php endif; ?>

			<?php if ( get_previous_posts_link() ) : ?>
			<div class="nav-next"><?php previous_posts_link( __( 'Newer posts', 'perth' ) ); ?></div>
			<?php endif; ?>

Best Regards,
Csaba

Hi, cheers but that seems to have broken the site:

Parse error: syntax error, unexpected ‘<’ in /home/dh_5bq9cp/helixclimate.eu/wp-content/themes/perth-pro-ii-child/functions.php on line 35

Hi,

Don’t add that code to functions.php, edit it in template-tags.php, pasting it to functions.php will break your site.

Best Regards,
Csaba

Hi Thanks for that I will try your suggestion and report back!

Cheers

Hi, there is no template-tags.php on the child theme. And if I edit that on the parent theme the changes will be lost after the next update?

Cheers

Hi,

You can add that file to your child theme, just create a new folder called “inc” and create a file called template-tags.php and paste the code in it, then it should work.

Best Regards,
Csaba

Hi thanks, I just did that but it has not worked.

Cheers

ps: could it be because the name of the parent template is perth-pro-ii and not perth?

Hi,

If that won’t work in Child Theme, then please modify it in the Parent Theme and save out the modification, so you can easily re-apply after updates.

Best Regards,
Csaba