- This topic has 5 replies, 2 voices, and was last updated 3 years, 10 months ago by David.
-
AuthorPosts
-
June 16, 2020 at 5:28 am #1329809Keir
On my site, whenever I create a multi page post (using page-break tags/block) the pagination appears after the WP likes and my social sharing buttons which means people miss the navigation. (div.page-links)
Can I move it to before these using a code snippet? (I have the plugin)
Also, is there any way of adding next-page, previous page links? The ones you can see on the page I have linked to have been manually added using generate blocks – but this is a suboptimal solution.
June 16, 2020 at 5:53 am #1329834DavidStaffCustomer SupportHi there,
do the WP Likes and Social Sharing plugins provide shortcodes ( or PHP functions ) to display theml?
If so you can use a Hook Element to add them to your posts:
https://docs.generatepress.com/article/hooks-element-overview/
If you select the
after_content
hook they will appear after the Pagination.Post Navigation (Next / Previous) post is an option in Customizer > Layout > Blog:
June 16, 2020 at 6:56 am #1329912KeirThanks for the prompt reply and the tips.
I’ve been able to move the social sharing buttons via shortcode – so thanks for that.
The like button looks more complicated (https://jetpack.com/2013/06/10/moving-sharing-icons/) I don’t really understand php, so I would be stabbing in the dark trying to implement the code they give here.
In the meantime, I have used css to position the ‘likes’ in the right place using position relative. It’s a bodge, but it produces the right visual effect for now.
June 16, 2020 at 7:04 am #1329921DavidStaffCustomer SupportFor the Likes try this:
1. Add this PHP Snippet to your site:
function jptweak_remove_share() { remove_filter( 'the_content', 'sharing_display', 19 ); remove_filter( 'the_excerpt', 'sharing_display', 19 ); if ( class_exists( 'Jetpack_Likes' ) ) { remove_filter( 'the_content', array( Jetpack_Likes::init(), 'post_likes' ), 30, 1 ); } } add_action( 'loop_start', 'jptweak_remove_share' );
https://docs.generatepress.com/article/adding-php/
In theory that should remove the Likes button.
2. Then in your Hook Element add:
<?php if ( class_exists( 'Jetpack_Likes' ) ) { $custom_likes = new Jetpack_Likes; echo $custom_likes->post_likes( '' ); } ?>
Make sure to check Execute PHP for that one
June 16, 2020 at 8:42 am #1330158KeirBrilliant!
That’s given me lots of possibilities to play around with.
THANK YOU!
June 16, 2020 at 9:40 am #1330227DavidStaffCustomer SupportYou’re welcome
-
AuthorPosts
- You must be logged in to reply to this topic.