- This topic has 18 replies, 4 voices, and was last updated 3 years, 2 months ago by
Ying.
-
AuthorPosts
-
March 3, 2023 at 2:46 pm #2554659
Wayne
Hey guys,
I am really having trouble figuring out why my blog posts aren’t dividing into pagination with the standard Page Break Module? The page is breaking at the right points, but the page buttons aren’t populating at the bottom of the post. Can anyone help me figure this out? I have turned off every single plugin and gone through all the cache clearing, but nothing. I can’t even seem to see the code for the page break in Google Developer Tools. I am at a loss. The post I am attempting to use this on is https://staging4.zealoushomes.com/a-prayerful-appeal-for-christian-zeal-part-2/
I am trying to break the post up into separate pages to reduce the DOM nodes and speed up the post. Any assistance would be appreciated. Thanks in Advance.
March 4, 2023 at 5:23 am #2555171David
StaffCustomer SupportHi there,
how is that page constructed? Is it using a Block Element Content Template ?
March 4, 2023 at 11:34 am #2555644Wayne
Hi David,
Yes, I used Generate Blocks Pro and Gutenberg to build the post.
March 4, 2023 at 12:23 pm #2555692Leo
StaffCustomer SupportHi Wayne,
David is asking if the single post is constructed with a Block Element Content Template and I believe it is:
https://docs.generatepress.com/article/block-element-content-template/Can you go to Dashboard > Appearance > Elements and temporarily set the status of that Content Template to draft and see if everything works correctly?
If that’s the case then we might need to try a workaround solution without using the Content Template.
Let me know 🙂
March 4, 2023 at 4:47 pm #2555838Wayne
Okay, so I did as you said and the post pages do show up that way. Now there are numbers and it looks like a category folder under the numbers which I do not want to show up. The formatting of the page is obviously not correct either. While we are at it is there a way to center the page numbers under the post and before the Social Sharing tool?
March 4, 2023 at 5:51 pm #2555860Leo
StaffCustomer SupportHey Wayne,
I’m able to replicate this bug on my end. I’ve asked Tom if this is indeed a bug or simply a limitation on using the content template for single posts.
Can we wait for his reply so I know what’s the best way to move forward?
Thanks.
March 4, 2023 at 7:24 pm #2555891Wayne
Hey Leo,
Thanks for looking into the issue. We can wait until he responds back. Do you think we can remedy the situation soon, or will it be a longer term solution? Trying to get an idea on the timeframe. Appreciate you guys.
Thanks.
March 5, 2023 at 5:13 am #2556180David
StaffCustomer SupportCouple of options:
Option 1 – in your Content Template. Are you using the GP Dynamic Content Block for the post content?
If so replace that with a core Post Content Block.
NOTE: the core block will return no preview and will state:Block cannot be rendered inside itself.– but this can be ignored in the content template.If that don’t work.
Option 2
1. Add this PHP Snippet to your site:
add_shortcode('page_links', function(){ ob_start(); wp_link_pages( array( 'before' => '<div class="page-links">' . __( 'Pages:', 'generatepress' ), 'after' => '</div>', ) ); return ob_get_clean(); },100);2. Then in your content template add the
[page_links]shortcode where you want the links to appear.Let me know.
March 5, 2023 at 9:36 am #2556546Wayne
Hey David,
Option one worked fine. Do you know if dynamic content will eventually be able to work with the page break module? Also, I am new to learning coding. Can you help me figure out how to center the page numbers and put a little padding on the top and bottom of them? I’d really appreciate it. Thanks for helping me get the main issue resolved. You guys rock!
March 5, 2023 at 9:53 am #2556558David
StaffCustomer SupportThats great.
You can add this CSS to apply some styles to those links:
/* Soace above and below and center page links */ .dynamic-content-template .post-nav-links { text-align: center; padding-top: 10px; padding-bottom: 10px; } /* add links styles */ .dynamic-content-template .post-nav-links .post-page-numbers { padding: 5px 10px; border: 1px solid #000; color: #000; border-radius: 3px; text-decoration: none; } /* change link background on hover */ .dynamic-content-template .post-nav-links .post-page-numbers:hover { background-color: #ccc; } /* change current link colors */ .dynamic-content-template .post-nav-links .post-page-numbers.current { background-color: #000; color: #fff; }Do you know if dynamic content will eventually be able to work with the page break module?
If its a quick easy fix then probably.
But the Core Post Content Block does the job in this instance. And we have plans to migrate all GP Dynamic Data functions ( that are currently missing from ) to GenerateBlocks. As their is some overlap now. And we will ensure that there is a working method for thisMarch 6, 2023 at 8:10 am #2557602Wayne
Hi David,
Thanks for taking the time to write that code. Unfortunately, it doesn’t seem to be working. Any thoughts? I added it into Simple CSS.
March 6, 2023 at 11:34 am #2557841Ying
StaffCustomer SupportHi Wayne,
Where can I see the content template with [page_links] shortcode?
Let me know!
March 6, 2023 at 11:52 am #2557859Wayne
Hello Ying,
We were trying to get the page links to center with some padding above and below on blog posts. This is the posts that we were working on https://staging4.zealoushomes.com/a-prayerful-appeal-for-christian-zeal-part-2/
Thanks for looking into it.
March 6, 2023 at 12:27 pm #2557897Ying
StaffCustomer SupportHave you added the shortcode? I’m not seeing it on the post you linked.
Let me know if I miss anything!
March 6, 2023 at 1:17 pm #2557933Wayne
Hi Ying,
No, I used the WP Block. David gave me two options (above in comments) to fix the initial issue. I was able to fix it with option one, so I didn’t need to use a shortcode. If you look at the bottom of the post, there are pagination navigation label that work. David was trying to help me with CSS to center them and put a little padding around them. Unfortunately, the CSS didn’t work. So I was hoping we could tweak the CSS or find a work around to adjust it. I hope that makes sense.
-
AuthorPosts
- You must be logged in to reply to this topic.