Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

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

1 Answer 1

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.