WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am trying to modify a query from wpmudev called global blog posts . I need it to not show any of the default blog posts, the first post on each blog.

$query = "SELECT * FROM " . $wpdb->base_prefix . "site_posts 
WHERE blog_public = '1' 
AND post_type ='" . $recentglobalpoststype . "' 
ORDER BY post_published_stamp 
DESC LIMIT " . $recentglobalpostsnumber;

I need to suppress the default blog post from each blog. Any ideas, I tried

$query = "SELECT * FROM " . $wpdb->base_prefix . "site_posts 
WHERE blog_public = '1' 
AND post_type ='" . $recentglobalpoststype . "' 
AND ID <> 1 
ORDER BY post_published_stamp 
DESC LIMIT " . $recentglobalpostsnumber;
share|improve this question

Can you use the SQL OFFSET statement:

OFFSET 1

$query = "SELECT * FROM " . $wpdb->base_prefix . "site_posts 
WHERE blog_public = '1' 
AND post_type ='" . $recentglobalpoststype . "' 
ORDER BY post_published_stamp 
OFFSET 1
DESC LIMIT " . $recentglobalpostsnumber;
share|improve this answer
    
No unfortunately the OFFSET 1 crashed the site. So I had to remove it to fix it. – Chris Collins May 30 '12 at 4:35

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.