Forum Replies Created
-
AuthorPosts
-
April 9, 2023 at 1:50 am in reply to: Reposition Single Post (Page Break) Pagination Directly Under Content #507205BrandonPDuncanParticipant
Well, it certainly isn't pretty, but it works.
Snippet:
// Coding to Re-order Jetpack Sharing Buttons, Likes, and Related Posts.
add_action( 'genesis_before_entry_content', 'reposition_jetpack_sharing_buttons' );
add_action( 'genesis_entry_footer', 'reposition_jetpack_sharing_buttons' );
add_action( 'genesis_entry_footer', 'reposition_jetpack_likes' );
add_action( 'genesis_entry_footer', 'reposition_Jetpack_RelatedPosts' );function reposition_jetpack_sharing_buttons(){
remove_filter( 'the_excerpt', 'sharing_display', 19 );
remove_filter( 'the_content', 'sharing_display', 19 );
if ( class_exists( 'Jetpack_Likes' ) ) {remove_filter( 'the_content', array( Jetpack_Likes::init(),'post_likes' ),30, 1 );
}
if ( class_exists( 'Jetpack_RelatedPosts' ) ) {
$jprp = Jetpack_RelatedPosts::init();
$callback = array( $jprp, 'filter_add_target_to_dom' );
remove_filter( 'the_content', $callback, 40 );
}if ( function_exists( 'sharing_display' ) ) {
echo sharing_display();
}
}function reposition_jetpack_likes() {
if ( class_exists( 'Jetpack_Likes' ) ) {$custom_likes = new Jetpack_Likes;
echo $custom_likes->post_likes( '' );
}
}function reposition_Jetpack_RelatedPosts() {
if ( class_exists( 'Jetpack_RelatedPosts' ) ) {
echo do_shortcode( '[jetpack-related-posts]' );
}
}Site:
April 8, 2023 at 11:45 pm in reply to: Reposition Single Post (Page Break) Pagination Directly Under Content #507202BrandonPDuncanParticipantSir, good call. I disabled the GSH Plugin and changed the hook for the sharing buttons to "genesis_before_entry" and it worked (no duplication).
Ok, I will try to find the functions to do same thing for the Jetpack "Like" and "Related Posts".
I am curious, since I did not have to add any code to do the entry_pagination (I have not added single post navigation yet---I am only working with native wordpress breaking posts into multiple pages), how would I go about hooking them to a different location?
Can I theoretically use the "single post nav" code and just change the function to "entry_navigation"? I wouldn't think the page breaks are a Genesis thing, but wordpress...
Thanks for the help. I appreciate it.
April 8, 2023 at 3:24 pm in reply to: Reposition Single Post (Page Break) Pagination Directly Under Content #507200BrandonPDuncanParticipantAs for moving Jetpack, the code provided for this adds a second row of share buttons only. I can put them wherever, hook-wise, but it doesn't move or remove the original placement, therefore the entry_pagination is still stuck under everything.
April 8, 2023 at 3:10 pm in reply to: Reposition Single Post (Page Break) Pagination Directly Under Content #507199BrandonPDuncanParticipantSorry, I'm stationed in S. Korea. Big time zone difference.
I started with the instructions in this post here: https://studiopress.community/topic/pagination-exclusion-and-positioning/
That post links to your tutorials:
1. https://wpsites.net/genesis-tutorials/reposition-or-modify-genesis-single-post-navigation/I attempted to copy/paste the reposition code block into my child theme Functions.php - no result. I installed Genesis Simple Hooks, but I have no clue what piece to place in the after content hook.
I want to say I did this on a site years ago, but a lot has changed in the Genesis code since then... and i'm rusty...
April 8, 2023 at 6:20 am in reply to: Reposition Single Post (Page Break) Pagination Directly Under Content #507194BrandonPDuncanParticipantHello, Brad. I did not add any code to get the entry-pagination to work, so I really do not know what code to add in Genesis Simple Hooks. I tried a block of code from a tutorial you pointed to here on the forum and nothing happened.
As for repositioning Jetpack, I haven't tried, but I will let you know.
BrandonPDuncanParticipantSorry, the site is http://dadsroundtable.com/writeontheroad. There's nothing really there yet, however. I'm just starting the structure.
-
AuthorPosts