Replace one of the Related Posts by a custom result
-
Hi..
[ask] is there any one could help me how to Replace one of the Related Posts by a custom result on all post with jackpack.
i found his on jetpack support page :
Replace one of the Related Posts by a custom result, for a specific postfunction jetpackme_append_related_post( $hits, $post_id ) { // $post_id is the post we are currently getting related posts for if ( 2194 == $post_id ) { // Add 1036 to the front of the hits array array_unshift( $hits, array( 'id' => 1036 ) ); // Remove the last element of the array array_pop( $hits ); } return $hits; } add_filter( 'jetpack_relatedposts_filter_hits', 'jetpackme_append_related_post', 20, 2 );
but that code is for Replace one of the Related Posts by a custom result, for a specific post.
the question is how do i Replace one of the Related Posts by a custom result on all post in my blog. please help.. i’m not very good with code..
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘Replace one of the Related Posts by a custom result’ is closed to new replies.