-
AuthorPosts
-
June 26, 2019 at 7:44 am #1113498
Hi guys
On the blog section below, we’re using the Masonry element. Have set Pagination to ‘Display Pagination’ however when navigating to a post, there is no pagination/navigation at top/bottom or anywhere on the post?
Is there another setting to enable?
cheers
June 26, 2019 at 1:42 pm #1113608Hey pantoni,
Thanks for the details, could you post WordPress login details as well please?
Best regards,
RikardJune 26, 2019 at 1:55 pm #1113612Hi Rikard
Here you go – thank you!
Just so you know – I’ve also just added the Functions.php code supplied by one of your colleagues to display the block at bottom of Posts “You might also like”;
—————————————————————————
function related_posts_shortcode( $attr ) {
ob_start();
get_template_part( ‘includes/related-posts’ );
return ob_get_clean();
}
add_shortcode( ‘rpost’, ‘related_posts_shortcode’ );
—————————————————————————Cheers
June 27, 2019 at 9:22 am #1113835Hi,
Thanks for that, you only have 2 posts in that category. There won’t be any pagination unless there are more posts than you have selected, in your case 8.
Best regards,
RikardJune 27, 2019 at 9:30 am #1113840HI Rikard
I’ve got 4 posts in the blog section now but still not working?
https://loop2019.wpengine.com/inspire/thanks
June 27, 2019 at 7:49 pm #1114079Hi pantoni,
Try adding one or two more and the pagination will show up.
Best regards,
VictoriaJune 28, 2019 at 2:20 am #1114140Hi Victoria
I tried around 10 but still no display. Just wondering if I can do the following?….Inside the ‘Inspire’ blog section, for each of the Posts, I now have the bottom block working well – “You might also like”, using this functions code:
——————————-
function related_posts_shortcode( $attr ) {
ob_start();
get_template_part( ‘includes/related-posts’ );
return ob_get_clean();
}
add_shortcode( ‘rpost’, ‘related_posts_shortcode’ );
——————————-
I would like to display the same block at the bottom of each of the Portfolio items inside the “Projects” section.
Is this possible??Many thanks.
June 28, 2019 at 12:06 pm #1114233Hi,
Thank you for the update.
You should be able to duplicate that shortcode and use it for your portfolio items. Just replace the “related-posts” with “related-portfolio-posts” so that it displays the correct post type or taxonomy.
Best regards,
IsmaelJune 29, 2019 at 4:40 am #1114396Hi Ismael
I duplicated that code and tried a few syntax variations but it either clashed with the existing code, or it removed the related posts block from the Inspire blog section all together.1. First code I tried was: duplicate and only changed this line… ‘includes/related-portfolio-posts’ );
That caused an error
—————————————
Your PHP code changes were rolled back due to an error on line 30 of file wp-content/themes/enfold-child/functions.php. Please fix and try saving again.Cannot redeclare related_posts_shortcode() (previously declared in wp-content/themes/enfold-child/functions.php:18)
2. Then tried this code… and removed the Inspire bottom block
—————————————-
function related_portfolio_posts_shortcode( $attr ) {
ob_start();
get_template_part( ‘includes/related-portfolio-posts’ );
return ob_get_clean();
}
add_shortcode( ‘rpost’, ‘related_portfolio_posts_shortcode’ );
—————————————
Would you have the exact full code for this?Many thanks
July 1, 2019 at 8:51 am #1114817Hi,
Thank you for the update.
You should also adjust the name of the shortcode from “rpost” to something else.
add_shortcode( ‘rpost’, ‘related_portfolio_posts_shortcode’ );
Change the name of the shortcode tag.
Best regards,
IsmaelJuly 2, 2019 at 3:29 am #1115000Hi Ismael
Still no luck – I’ve included all the code for both the ‘Inspire’ blog section, and the ‘Projects’ section below. The updated code allows the blog section to display the “You may also like’ block correctly, but NOT for the ‘Projects’ section. I must still have the syntax incorrect???—————————————————————————————————————————–
/* enables Inspire post footer You May Also Like */
function related_posts_shortcode( $attr ) {
ob_start();
get_template_part( ‘includes/related-posts’ );
return ob_get_clean();
}
add_shortcode( ‘rpost’, ‘related_posts_shortcode’ );/* enables Projects post footer You May Also Like */
function related_portfolio_posts_shortcode( $attr ) {
ob_start();
get_template_part( ‘includes/related-portfolio-posts’ );
return ob_get_clean();
}
add_shortcode( ‘rpostport’, ‘related_portfolio_posts_shortcode’ );
—————————————————————————————————————————–
Thank you.July 4, 2019 at 2:08 pm #1115775Hi,
Thank you for the update.
Did you change the shotcode from “[rpost]” to “[rpostport]”? That’s the new name or tag of your shortcode.
Best regards,
IsmaelJuly 4, 2019 at 2:28 pm #1115783Hi Ismael
Yes as you suggested – I changed the shortcode from “[rpost]” to “[rpostport]” as per complete code posted above.Then went into a Portfolio item, added a Code element with that shortcode in it, however it only displays the shortcode text [rpostport] instead of the actual content block. You can see that on this example page at the bottom…
Thanks.July 8, 2019 at 3:12 am #1116530Hi,
Thank you for the update.
I can’t access the site — leads to 401 authentication page. Are you sure that the shortcode isn’t added as text? This usually happens when you add the shortcode in the “Visual” mode of the editor instead of the “Text/HTML” mode.
Best regards,
IsmaelJuly 8, 2019 at 3:27 am #1116535Hi Ismael
The shortcode is added into a Code Element – same as per the ‘Inspire’ Blog posts. So there is no visual editor. I have tried adding as a Text element but same issue. You can see an example below of using the Code element – at bottom of page it displays the short code text instead of the content block.
PleaseJuly 9, 2019 at 3:38 am #1116857Hi,
I can’t access the site as previously stated. The page is asking for a Microsoft authentication and I don’t have any idea where to get it. It redirects to an NGINX 401 Authentication Required page when I cancel the authentication. Can you disable the extra authentication temporarily?
Best regards,
IsmaelJuly 9, 2019 at 3:57 am #1116867Hi Ismael
Are you talking about this url and details below or WP Admin? It’s working fine here.July 9, 2019 at 11:04 am #1117007Hi,
Thanks for the update.
I forgot to mention that you have to create the includes > related-portfolio-posts.php file manually. After creating the file, use this code.
// https://pastebin.com/QngXiH7J
Best regards,
Ismael -
AuthorPosts
- You must be logged in to reply to this topic.