Support community for TTG plugins and products.
NOTICE
The Turning Gate's Community has moved to a new home, at https://discourse.theturninggate.net.
This forum is now closed, and exists here as a read-only archive.
You are not logged in.
Good morning,
I am struggling creating a child theme for Wordpress (based on Pangolin). What I want to do is to replace this part of the loop.php file:
the_posts_navigation();
with this
<?php if (show_posts_nav()) :?>
<article class="post-navigation">
<p>
<?php if(get_previous_posts_link()) { ?>
<span class="newer-posts"><?php previous_posts_link( __('Previous', 'wordpress_main') ); ?></span>
<?php } else { ?>
<span class="newer-posts no-more-posts"><?php _e('Previous', 'wordpress_main'); ?></span>
<?php } ?>
<span class="post-navigation-divider">/</span>
<?php if(get_next_posts_link()) { ?>
<span class="older-posts"><?php next_posts_link( __('Next', 'wordpress_main') ); ?></span>
<?php } else { ?>
<span class="older-posts no-more-posts"><?php _e('Next', 'wordpress_main'); ?></span>
<?php } ?>
</p>
</article>
<?php endif; // if prev/next links ?>
The code itself is working for me (copied the loop.php file to my child theme folder) but I thought if it would be easier to use the functions.php file to replace it there.
I tried to find the function but I failed. Where is this function declared?
Last edited by MoritzCH (2017-07-05 16:41:04)
Offline
It's a Wordpress function.
https://developer.wordpress.org/referen … avigation/
Offline
oh man, I was looking for this function inside the theme folder -.-
As this is a core function I guess there isn't an easy way to rewrite it. Copy the whole php files (in my case loop.php and content.php) and change the parts is the way to go (at least for me).
Thank you!
Offline