You may install this plugin and then for the next link, use:
<?php c2c_next_or_loop_post_link('%link','<img src="https://wordpress.stackexchange.com/questions/259353/img-location"/>'); ?>
and for the previous link use:
<?php c2c_previous_or_loop_post_link('%link','<img src="https://wordpress.stackexchange.com/questions/259353/img-location"/>'); ?>
That’s it. Now the previous link of your first post should be the last post and the next link of your last post should be the first post.
If you don’t want to install any plugin, then you may follow the instructions from this post to see how it can be done with custom CODE.
Related Posts:
- Can’t get the previous and next posts permalink
- next_posts_link not working in custom loop
- Next Posts Prev Posts for Standard post format only
- How to exclude or filter password protected posts when using next_post_link() previous_post_link
- How to filter get previous post function by meta value DESC and post date DESC?
- Multiple loops using next_posts_link & previous_posts_link
- How can I limit the length of the previous/next posts in my WordPress Theme?
- Problem excluding category from get_next_post
- specify meta_key / meta_value condition for prev_post_link and next_post_link
- Is it possible to nest get_previous_post()?
- Why do next pages load the same content rather then older articles?
- previous/next_post_link in the same sub-category?
- get_adjacent_post – in same term or category not working
- next_post_link / previous_post_link not working with WP_Query
- Pagination for custom loop on custom page template is not displaying anything
- Next/Previous links doesn’t work in the same category
- How do I display a greyed out next_post_link when there is no next post
- Page Navigation Outside the Loop
- Include “Scheduled” (“Future”) Posts in WordPress Post Navigation ( previous_post_link, next_post_link ) for a Specific Custom Post Type
- How to get next post link of child custom post type from parent post and get next post link of parent post from the last child post?
- How to exclude posts by meta key value in the_post_navigation next prev links?
- Prev/Next Navigation on Single Post Disappeared for Custom Post Type
- Change URL of previous posts and next posts link in WordPress
- Dynamic next and previous post links
- Post in multiple categories do not include in previous / next post if one category in excluded
- Previous Posts Link and Next Posts Link Show All The Same Articles?
- posts_nav_link() not working on index.php
- Previous / next posts using featured image thumbnail as links
- How to display Yoast SEO meta description in archive template for each post instead of the_excerpt()? [closed]
- How to place comments_template(); outside the loop?
- Endless loop with wp_insert_post and wp_update_post
- How do I prevent one of two multiple loops from repeating on a second page?
- Hook into the loop via a plugin, and output something after every X post?
- Two custom loops, pagination, offset
- Access to Media Library
- Getting two wp_link_pages output
- How do you split multiple-column loop on category archive page?
- How to Loop within a Loop (Display Children and then Grandchildren)
- Run The Loop over array of post objects
- Show top level comments ordered by number of replies
- Redirect Loop to Page, Can’t Find Origin, Can’t Remove [closed]
- wordpress change the loop order by dynamic value
- Post Format single-loop.php using get_template_part
- Display posts from multiple user roles
- A loop with all articles with certain text strings in tags
- Prevent Headers from being sent
- How do I get row padding in a post feed?
- How can I create a legend (Key) like the one in the footer on WordPress StackExchange
- It is possible to encounter horrible bugs if I place a main loop that uses `query_posts` right above the main bbPress loop?
- How to show “teaser” posts on blog / archive pages, otherwise full posts
- Make blog page show 10 on first page, 9 on every other page
- Alter query using pre_get_posts() if meta_key is present
- Two loops on different pages do the same thing, but only one page works
- Posts active and expired in different loops
- Genesis multiple category custom loop 404s after first page
- Shortcode in posts called by ajax is not working
- Using Javascript for Looped Content
- Making a query to the DB using same parameters of loop
- Variable not being passed into WordPress loop
- Exclude duplicated $sticky post from combined loop content
- Getting a custom field in the middle of a loop
- Pagination on Single Post
- Single: Prev and next Post in same order as main query, in all categories
- WP Loop. If featured image is a panorama (3:1 ratio) execute some code
- Trying to get property of non-object in shortocde
- Foreach displays from last to first
- How to Loop with the final result formatted differently?
- Tags on page (not post) returns nothing – why? Improved clarified question!
- Include future posts in tags and in search
- Category ID returns as ‘0’?
- Show terms in archive page
- Next Prev Post link rendering current post thumbnail
- Static Website No Titles But Still Nav
- Loops for cat links not looping for wordpress site
- Skip 5 latest post while paging?
- Sort posts according to a numeric value entered with ACF
- Order by post_date does not work in Previous and Next post pagination
- wp_get_attachment_url not fetching URL?
- get the value for ALT is we check to see if an actual ALT value is set, if not we use the caption and if no caption is set we use the title
- How to get all multi-select user meta values and add them to an array?
- How to resolve a reload loop issue in the frontend when logged in to WordPress multi-site backend admin area
- Exclude Posts Using Meta Query and User Meta
- Excerpt isn’t working or am I missing something?
- Can I temporarily disable global $post?
- Previous/Next custom post links within custom taxonomy
- Shortcode for pulling specific Post Title outside loop when ID is passed in
- How to know if the most recent article
- Show a list of user posts in the user admin page
- Infinite Loop after Genesis Theme Upgrade
- Active class for my flexslider in WordPress
- WordPress loop only displays 5 articles max?
- get_template_part() to render single page Theme
- Can’t see custom field after the Loop [closed]
- Showing related posts (custom post type) outside of the loop
- Paged homepage – requirements?
- Least Number of Loops to Create Custom Homepage?
- The Loop for my theme with static front page is not working
- WordPress loop: Display if posts exist
- Showing ads after posts in home page
- Prevent duplicating specific column from database table