Skip Navigation

[Resolved] Toolset genesis integration single post pagination not displaying

This thread is resolved. Here is a description of the problem and solution.

Problem:
The genesis Integration Layouts element "pagination" does not display single Posts pagination.

Solution:
That Cell is a "Post Navigation — pagination controls on archive pages":
https://toolset.com/documentation/user-guides/layouts-genesis-integration/

This is not a Single Post navigation.

The Pagination of single Posts will disappear if you apply a Layout to the whole Template.
Then you should either call them with an eventual ShortCode that Genesis might provide or by wrapping their function for it, into a Custom ShortCode.

This support ticket is created 7 years, 5 months ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

No supporters are available to work today on Toolset forum. Feel free to create tickets and we will handle it as soon as we are online. Thank you for your understanding.

Sun Mon Tue Wed Thu Fri Sat
- - 14:00 – 20:00 14:00 – 20:00 14:00 – 20:00 14:00 – 20:00 14:00 – 20:00
- - - - - - -

Supporter timezone: Asia/Ho_Chi_Minh (GMT+07:00)

This topic contains 9 replies, has 2 voices.

Last updated by Dallin Chase 7 years, 5 months ago.

Assisted by: Beda.

Author
Posts
#510766

I am trying to: add pagination to a single post

I visited this URL: hidden link

I expected to see: pagination at top of page

Instead, I got: no pagination

I have tested it with the genesis theme integration disabled and pagination shows up. As soon as I activate it the pagination disappears.

#510945

I think you use Layouts, since you use the Integration.

Layouts will let you customize the whole template of genesis, and as such, when you add a Layout to display a single Item like a Post, you would need to add as well the pagination ShortCode (if the Genesis Theme provides one), or, somehow call that feature in a Custom ShortCode.

What you can also do, is not use the Integration and just use Layouts as a Content Editor.
Then, the non-content parts will still be loaded by the theme.

You would then only style what you see in the Post Body, instead of the whole layout from header to footer.

THe integration is basically providing a method to style the whole template whithout the need fo coding and it allwos you to add this Genesis features as Cells:
https://toolset.com/documentation/user-guides/layouts-genesis-integration/ > Genesis Cells Options / Genesis rows options

As you can see the pagination is not part of them, but breadcrumbs is, perhaps you meant this?

Otherwise you'll have to either add those paginations as a ShortCode in a Cell, or, you use the content layout only, not the whole template layout.

#511282
Screen-Shot-2017-04-09-at-12.35.32-PM-compressor.png
Screen Shot 2017-04-09 at 12.35.14 PM.png
Screen Shot 2017-04-09 at 12.20.04 PM.png

Did I miss understood what "Post navigation" is? I thought that "Post navigation" would be a way to navigate to the next or previous post. I attached a photo of that choice in the plugin.

Another thing I have noticed. When the "Toolset Genesis Integration" is inactive you can see the previous and next post navigation links. But as soon as I activate the "Toolset Genesis Integration" they disappear. And when I use the Toolset to add them back in, they don't seem to display. I have attached screenshots of these as well.

Thank you for you assistance.

#511404

That Cell is a "Post Navigation — pagination controls on archive pages":
https://toolset.com/documentation/user-guides/layouts-genesis-integration/

This is not a Single Post navigation.

The Pagination of single Posts will disappear if you apply a Layout to the whole Template.
Then you should either call them with an eventual ShortCode that Genesis might provide or by wrapping their function for it, into a Custom ShortCode.

If you want, I can file a feature request for this.

#511901
Screen-Shot-2017-04-10-at-4.44.12-PM-compressor.png
Screen Shot 2017-04-10 at 4.41.23 PM.png

That is good to know. It would be much appreciated if this was added as a feature request. The integration has been amazing so far! This is the only thing I have come across.

I came up with a solution in the mean time. I created a shortcode that outputs the pagination. It seems to work great, the only issue is the placement. I know how to control placement of elements with Genesis hooks. But I am having issues with the placement when using Toolset. I have added the shortcode in a layout and in the content template. But it seems to output at the top above everything else. I have included some screenshots.

Thank you for your patience.

#511956

This is usually due to the shortcode echoing something instead of returning it.

You should never use "echo" in a shortcode but always "return".

Can you share the shortcode-code with me?

#512230

That may be the issue. Here is the code I was using.

function genesis_pagination_shortcode(){
genesis_markup( array(
'html5' => '<div %s>',
'xhtml' => '<div class="navigation">',
'context' => 'adjacent-entry-pagination',
) );
echo '<div class="pagination-previous alignleft">';
previous_post_link();
echo '</div>';
echo '<div class="pagination-next alignright">';
next_post_link();
echo '</div>';
echo '</div>';
}
add_shortcode( 'genesis_pagination', 'genesis_pagination_shortcode' );

#512500

Yes, you echo it.

That is not allowed.

A ShortCode should always return its contents.

See more here:
https://codex.wordpress.org/Shortcode_API > Output

#512801
Screen-Shot-2017-04-12-at-1.16.13-PM-compressor.png

Ok, so that seems to defiantly be part of it. I have updated my shortcode to this:

function genesis_pagination_shortcode( $text ){

previous_post_link( '<div class="previous">Previous article: %link</div>', '%title' );
next_post_link( '<div class="next">Next Post: %link</div>', '%title' );

return "<br>genesis nav";
}
add_shortcode( 'genesis_pagination', 'genesis_pagination_shortcode' );

I attached a screen shot of what this is producing.

#512820

I found a solution. I am using these shortcodes in the Toolset content template and it seems to work fine. But it would be great to have that feature added. Thank you for your help!

// Adds a previous and next shortcode for single posts
add_shortcode( 'prev', 'prev_shortcode' );
add_shortcode( 'next', 'next_shortcode' );
function next_shortcode($atts) {
global $post;
ob_start();
next_post_link( '<div class="button nav-next">%link</div>', 'Next' );
$result = ob_get_contents();
ob_end_clean();
return $result;
}

function prev_shortcode($atts) {
global $post;
ob_start();
previous_post_link( '<div class="button nav-previous">%link</div>', 'Previous' );
$result = ob_get_contents();
ob_end_clean();
return $result;
}

Dallin

This ticket is now closed. If you're a Toolset client and need related help, please open a new support ticket.