Title: Exclude current post/displaying post?
Last modified: August 21, 2016

---

# Exclude current post/displaying post?

 *  Resolved [Newfound](https://wordpress.org/support/users/precipitatejournal/)
 * (@precipitatejournal)
 * [12 years, 8 months ago](https://wordpress.org/support/topic/exclude-current-postdisplaying-post/)
 * Hi there!
 * I am interested in using your plugin at the bottom of the front page of my blog(
   www.hothousemagazine.org), which already displays the single most current post.
   My hope is to have my main blog page to show the current post and then (using
   your plugin) show visitors the top posts for the current week.
 * However, I’m wondering if there is a way to exclude the most recent post so that
   it doesn’t come up in the weekly count and show twice with this setup. Does this
   make any sense?
 * Your plugin looks great, btw!
 * Cheers!
 * [http://wordpress.org/plugins/top-10/](http://wordpress.org/plugins/top-10/)

Viewing 11 replies - 1 through 11 (of 11 total)

 *  Plugin Author [Ajay](https://wordpress.org/support/users/ajay/)
 * (@ajay)
 * [12 years, 7 months ago](https://wordpress.org/support/topic/exclude-current-postdisplaying-post/#post-4215262)
 * You can try the manual install in the FAQ
    [https://wordpress.org/plugins/top-10/faq/](https://wordpress.org/plugins/top-10/faq/)
 * Regarding excluding the most recent post, I think there might be a solution you
   can try, but it isn’t tested and I’m not sure if this will work, so please backup
   before editing files.
 *     ```
       $args = array( 'numberposts' => '1' );
       $recent_posts = wp_get_recent_posts( $args );
   
       foreach( $recent_posts as $recent ){
       $exclude_post_ids = $recent["ID"];
       }
   
       echo tptn_pop_posts( 'daily=1&is_widget=1&exclude_post_ids='.$exclude_post_ids );
       ```
   
 * Thanks for the compliment about my plugin. Do consider leaving a good review 
   🙂
 *  Thread Starter [Newfound](https://wordpress.org/support/users/precipitatejournal/)
 * (@precipitatejournal)
 * [12 years, 7 months ago](https://wordpress.org/support/topic/exclude-current-postdisplaying-post/#post-4215265)
 * Great! And where would I paste this code? On the same page that I paste in the
   manual install code?
 *  Plugin Author [Ajay](https://wordpress.org/support/users/ajay/)
 * (@ajay)
 * [12 years, 7 months ago](https://wordpress.org/support/topic/exclude-current-postdisplaying-post/#post-4215278)
 * Yes, in the footer maybe. Wherever you want the code to display
 *  Thread Starter [Newfound](https://wordpress.org/support/users/precipitatejournal/)
 * (@precipitatejournal)
 * [12 years, 7 months ago](https://wordpress.org/support/topic/exclude-current-postdisplaying-post/#post-4215291)
 * I pasted it in the loop.php. The manual code is displaying just fine but this
   extra code (just pasted it beneath) just displays as text. Do I need to put the
   code in <? ?> brackets? I’m not a php wizard, sadly. 🙁
 *  Plugin Author [Ajay](https://wordpress.org/support/users/ajay/)
 * (@ajay)
 * [12 years, 7 months ago](https://wordpress.org/support/topic/exclude-current-postdisplaying-post/#post-4215296)
 * Sorry, yes, you’ll need to wrap it in php tags. Are you sure loop.php is the 
   right place? It’s dependent from theme to theme, but ideally you’ll need to put
   this outside [the Loop part](https://codex.wordpress.org/The_Loop) of loop.php
 *     ```
       <?php
       $args = array( 'numberposts' => '1' );
       $recent_posts = wp_get_recent_posts( $args );
   
       foreach( $recent_posts as $recent ){
       $exclude_post_ids = $recent["ID"];
       }
   
       echo tptn_pop_posts( 'daily=1&is_widget=1&exclude_post_ids='.$exclude_post_ids );
   
       ?>
       ```
   
 *  Thread Starter [Newfound](https://wordpress.org/support/users/precipitatejournal/)
 * (@precipitatejournal)
 * [12 years, 7 months ago](https://wordpress.org/support/topic/exclude-current-postdisplaying-post/#post-4215300)
 * Well, I have things in the loop.php so they show on my main blog landing page
   thing, which shows the most recent blog. Maybe I should have said that before
   framing my initial question.
 * Okay, here’s maybe another way of looking at this problem: If I’m putting your
   sweet plugin in the loop, which will always show the most recent post, is there
   simply a way for the plugin to show my daily posts _except_ for the most recent??
 * Thanks for your time and patience!
 *  Plugin Author [Ajay](https://wordpress.org/support/users/ajay/)
 * (@ajay)
 * [12 years, 7 months ago](https://wordpress.org/support/topic/exclude-current-postdisplaying-post/#post-4215305)
 * The code above should ideally do that. Did you have a chance to look at it.
 * I’ve tried to fetch the latest post and then feed it as an exclusion. I can’t
   confirm if this is going to work 100% for sure.
 *  Thread Starter [Newfound](https://wordpress.org/support/users/precipitatejournal/)
 * (@precipitatejournal)
 * [12 years, 7 months ago](https://wordpress.org/support/topic/exclude-current-postdisplaying-post/#post-4215314)
 * Okay, I’ve posted in the code and the plugin is showing properly (although the
   daily posts title doesn’t show now, but that’s no big deal).
 * I can’t tell right now, however, if the code is working, as my top three posts
   are not the most current post. I will be sure to get back to you if it doesn’t
   accomplish this feat, just to let you know at least.
 * Cheers!
 *  Plugin Author [Ajay](https://wordpress.org/support/users/ajay/)
 * (@ajay)
 * [12 years, 7 months ago](https://wordpress.org/support/topic/exclude-current-postdisplaying-post/#post-4215324)
 * That sounds great. If you want the header to come back edit to code above. Change
   this line:
 *     ```
       echo tptn_pop_posts( 'daily=1&is_widget=0&exclude_post_ids='.$exclude_post_ids );
       ```
   
 *  Thread Starter [Newfound](https://wordpress.org/support/users/precipitatejournal/)
 * (@precipitatejournal)
 * [12 years, 7 months ago](https://wordpress.org/support/topic/exclude-current-postdisplaying-post/#post-4215335)
 * Aww, well, sadly it doesn’t seem to be working: [http://www.hothousemagazine.org/](http://www.hothousemagazine.org/),
   only looked as if it was working because the “most recent” needs time to catch
   up to be on my top 3 list.
 * If you come up with any other ideas, do shoot them this way. Integrating this
   in with a future release would be killer! 🙂
 *  Plugin Author [Ajay](https://wordpress.org/support/users/ajay/)
 * (@ajay)
 * [12 years, 7 months ago](https://wordpress.org/support/topic/exclude-current-postdisplaying-post/#post-4215336)
 * So, if I understand correctly, if your most recent catches up to be on the top
   3, it shows up in the Week’s Hottest?

Viewing 11 replies - 1 through 11 (of 11 total)

The topic ‘Exclude current post/displaying post?’ is closed to new replies.

 * ![](https://ps.w.org/top-10/assets/icon-256x256.png?rev=2986432)
 * [WebberZone Top 10 — Popular Posts](https://wordpress.org/plugins/top-10/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/top-10/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/top-10/)
 * [Active Topics](https://wordpress.org/support/plugin/top-10/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/top-10/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/top-10/reviews/)

## Tags

 * [exclude](https://wordpress.org/support/topic-tag/exclude/)

 * 11 replies
 * 2 participants
 * Last reply from: [Ajay](https://wordpress.org/support/users/ajay/)
 * Last activity: [12 years, 7 months ago](https://wordpress.org/support/topic/exclude-current-postdisplaying-post/#post-4215336)
 * Status: resolved