Community @ The Turning Gate

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.

  • New user registrations are disabled.
  • Users cannot create new topics.
  • Users cannot reply to existing topics.

You are not logged in.

#1 2017-07-05 16:36:30

MoritzCH
Member
From: Switzerland
Registered: 2014-02-25
Posts: 108
Website

Wordpress function (the_posts_navigation())

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

#2 2017-07-05 16:46:57

Matthew
Administrator
From: San Francisco, CA
Registered: 2012-09-24
Posts: 5,795
Website

Re: Wordpress function (the_posts_navigation())


Matt

The Turning Gate, http://theturninggate.net

Offline

#3 2017-07-05 17:43:48

MoritzCH
Member
From: Switzerland
Registered: 2014-02-25
Posts: 108
Website

Re: Wordpress function (the_posts_navigation())

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

Board footer

Powered by FluxBB