-
AuthorPosts
-
July 16, 2015 at 1:07 pm #332314
Hello,
Is it possible to have the single post next-previous arrow-navigation from Ethos within the stack Renew?
Would be great! πThx in advanced!
url: www . landelijk wonen magazine. nl
theme: RenewJuly 16, 2015 at 2:35 pm #332405Hi There,
Thanks for writing in.
You can check this link below maybe it would help because merging functions of stack is beyond the scope of our support.
Hope it helps.
Thanks.
July 27, 2015 at 7:41 am #341756Sorry, did not help me π
July 27, 2015 at 8:15 am #341795Hello Marco,
Thanks for writing in!
To setup next / previous button on blog post will require template change, I’d advise that you setup a child theme. This allows you to make code changes that won’t be overwritten when an X update is released. After your child theme is setup, please review how we recommend making template changes in Customization Best Practices.
Kindly use following code in your child themeβs functions.php file:
add_action ('the_content', 'add_next_post_item_link' ); function add_next_post_item_link ( $content ) { if ( is_singular('post') ) { $next_name = "Next Post <i class=\"x-icon-chevron-right\"></i>"; $prev_name = "<i class=\"x-icon-chevron-left\"></i> Previous Post"; $next_link = get_next_post() ? '<a style="float: left;" href="' . get_permalink( get_next_post()->ID ) . '">' . $prev_name . '</a>' : ''; $prev_link = get_previous_post() ? '<a style="float: right;" href="' . get_permalink( get_previous_post()->ID ) . '">' . $next_name . '</a>' : ''; $posts = '<div class="wp-post-navigation-next">'.$next_link.$prev_link.'</div>'; return $content . $posts; } else { return $content; } }
Let us know how it goes.
Thanks.
January 14, 2016 at 8:19 am #745926Hi,
I added the codes in function.php and manage to get the two arrows. How can I configure the previous and next arrow such that it will go to a specific post that I wish?
Thanks.
January 14, 2016 at 12:15 pm #746208Hi there,
Thanks for updating. It will automatically point to next post and previous post. If you want to link to any specific post then that will be unusual and you need to place hard coded link like –
$next_link = '<a style="float: left;" href="http://linktoyourpost.com">Your Next Post Title</a>';
Hope this helps.
Cheers!
January 14, 2016 at 8:29 pm #746800Thank you for clarifying. Assuming I have 10 posts all together. I realized I need to add a new post in between the 4th and 5th post in order to have a continuous flow of story. Using the default, previous and next post indicator, how can I influence such that inside the 4th post’s “next button”, it will point to a “New Post” instead of 5th post. Similarly, inside the 5th post, the “previous button” should now point to the “New Post” instead of 4th posts.
January 14, 2016 at 10:12 pm #746944Hello There,
You’re welcome.
Since next-previous is sorted in chronological order, you may want to edit POST DATE manually and make sure that the NEW POST date is between 4th and 5th post.
You may check this link :https://codex.wordpress.org/Function_Reference/get_next_posts_linkHope this helps.
-
AuthorPosts