Maybe I don’t understand the question, sorry in that case.
But can’t you just retrieve the last 6 posts excluding the current? Something like:
global $post;
$footer_posts = wp_get_recent_posts( array('post_status' => 'publish', 'posts_per_page' => '6', 'exclude' => $post->ID), 1 );
if ( ! empty($footer_posts) ) { foreach ( $footer_posts as $post ) {
setup_postdata($post);
echo '<div style="float:left; margin-left:20px;">';
echo '<a href="' . get_permalink() . '">';
the_post_thumbnail('thumb');
echo '<br /><h4 style="text-align:center;">' . get_the_title() . '</h4></a>';
echo '</div>';
} }
wp_reset_postdata();
Related Posts:
- Get Next / Prev 3 Posts in Relation to Current Post
- How to stick the footer to the bottom of the page? [closed]
- How to remove version and thank you message from the admin footer
- Can i put ‘page’ at the bottom of each page?
- Get next/previous cousin page
- How to make Next and Previous attached image navigation on the attachment page? [duplicate]
- Posts archive index pagination in a static page custom query
- footer.php – twentysixteen child theme – social links menu to output font awesome icons
- How to edit footer
- Loop – how to get previous/next post for first/last post?
- How do i change the footer?
- Where is the admin bar instantiated?
- Using wp_register_style to load CSS in footer?
- Next and Previous loop
- editing footer text in JBST theme
- get_previous_post in same categories
- Next Previous siblings child pages
- How to find the right file with inspector? [closed]
- get_adjacent_post() returning weird results
- WordPress Footer Missing After Website Hack
- wp_footer hook not working inside a class if not single [closed]
- next and previous year month and day for archive page
- Identify the page I am viewing
- Removing a link below from footer
- Add title for previous and next posts to Yoko Theme
- WordPress Site footer on Firefox displays a error
- How to edit footer content
- Styling Previous/Next Pages differently from Index
- Changing copyright year in Footer.php with Custom plugin
- footer does not respect css stylesheet
- How to fix the footer to the bottom of the screen
- Get previous/next post from (specific) category
- Delete bullet points in footer menu [closed]
- Getting A Link below footer – Want to remove it. How?
- How can I change the prev / next buttons text to Dutch?
- How can I change this footer.php code to call a random image on reload?
- How To Show Get Adjacent Posts If Posts Are Sorted By Custom Field
- Show multiple next and previous posts
- Editing footer for one page, keeping it the same for others
- Plugin: Events manager – Next and previous event
- Place Footer at bottom of page with short text
- Can’t deregister / dequeue scripts in WordPress
- Code for changing the size of the footer block (background) and font size
- How to add another image on footer.php
- On just 1 (new) page of my site there appears a wordpress footer with copyright 2012 which I want to remove
- Footer not visible
- how to edit part of footer
- How to remove the footer from a theme
- footer display problem
- How I can Delete Footer without using plugin BlankSlate?
- My footer has disappeared but only on my home page
- WordPress The Next Posts
- Display NEXT and PREVIOUS pagination? [duplicate]
- Meta Slider Lite plugin shortcode in post not working
- Category foreach Paging
- get next/previous post name
- Is that the query_posts() the real criminal here?
- Move jquery ui to footer
- How do I change the footer (Norma) [closed]
- Re-position footer and force it to drop below blog post excerpts on home page [closed]
- How can I completely edit the footer?
- How to edit the WordPress footer
- How to Keep footer link remain intact?
- Footer Missing in website [closed]
- Add a “Next Post” & “Previous Post” styled button manually to a post
- CSS to make HTML page footer stay at bottom of the page with a minimum height, but not overlap the page
- Fix footer to bottom of page
- force footer on bottom on pages with little content
- How to make a sticky footer in react?
- jquery, find next element by class
- How can I make my footer center to the bottom of the page?
- Flushing footer to bottom of the page, twitter bootstrap
- What does hasNext() in a While do?
- What does wp-embed.min.js do in WordPress 4.4?
- How to load css in the footer [duplicate]
- how to remove default jquery and add js in footer?
- How To Remove WordPress Version From The Admin Footer
- How to add javascript just before the closing body tag in the footer of WordPress
- Auto get_header and get_footer on every template?
- Get previously visited page ID
- My add_action (wp_footer, ‘method’) is not calling?
- How to add code to just before closing body tag
- How can I add a custom script to footer of login page?
- wp_enqueue script my_javascript_file in the footer
- How to add JS in footer
- How to remove “Proudly powered by WordPress” in Twenty Sixteen (2016) theme?
- Hook for writing text string after footer scripts
- How can I remove “Proudly powered by WordPress” from twentyeleven without modifying footer.php?
- Add script to footer – on post editor
- Wp_head and wp_footer vs wp_enqueue_script javascript files?
- enqueuing React script and hooking its target div fails to load script
- Share buttons on article footer
- Add footer.php to WordPress child theme
- Proper Javascript Implementation
- How to call a plugin function in footer.php
- How do you completely remove the default header and footer using functions.php?
- Sharing Header Components Across Multisite
- Why and how is twentythirteen adding a margin-top to my footer?
- Template part vs Sidebar (differences)
- Change directory where get_header(), get_footer() and get_sidebar() look for templates