Skip to main content
Proper formatting
Source Link
Pieter Goosen
  • 55.4k
  • 23
  • 115
  • 209
$exclude_posts = array();//array of id's that are in aggregato custom fields
$query = new WP_Query( array(
    'post_type' => array( 'post', 'aggregato' ),
    'posts_per_page'=> 12,
    'posts_not_in' => $exclude_posts,
    'meta_query' => array(
        array(
            'key' => 'home',
            'value' => '_wp_zero_value',
            'compare' => '>'
             )
    )
    ) );

You can check this http://codex.wordpress.org/Class_Reference/WP_QueryWP_Query for more info

youYou can use url_to_postid()url_to_postid() to get id's from url's

http://codex.wordpress.org/Function_Reference/url_to_postid

$exclude_posts = array();//array of id's that are in aggregato custom fields
$query = new WP_Query( array(
    'post_type' => array( 'post', 'aggregato' ),
    'posts_per_page'=> 12,
    'posts_not_in' => $exclude_posts,
    'meta_query' => array(
        array(
            'key' => 'home',
            'value' => '_wp_zero_value',
            'compare' => '>'
             )
    )
    ) );

You can check this http://codex.wordpress.org/Class_Reference/WP_Query for more info

you can use url_to_postid() to get id's from url's

http://codex.wordpress.org/Function_Reference/url_to_postid

$exclude_posts = array();//array of id's that are in aggregato custom fields
$query = new WP_Query( array(
    'post_type' => array( 'post', 'aggregato' ),
    'posts_per_page'=> 12,
    'posts_not_in' => $exclude_posts,
    'meta_query' => array(
        array(
            'key' => 'home',
            'value' => '_wp_zero_value',
            'compare' => '>'
             )
    )
    ) );

You can check WP_Query for more info

You can use url_to_postid() to get id's from url's

Source Link
bravokeyl
  • 3.4k
  • 6
  • 27
  • 33

$exclude_posts = array();//array of id's that are in aggregato custom fields
$query = new WP_Query( array(
    'post_type' => array( 'post', 'aggregato' ),
    'posts_per_page'=> 12,
    'posts_not_in' => $exclude_posts,
    'meta_query' => array(
        array(
            'key' => 'home',
            'value' => '_wp_zero_value',
            'compare' => '>'
             )
    )
    ) );

You can check this http://codex.wordpress.org/Class_Reference/WP_Query for more info

you can use url_to_postid() to get id's from url's

http://codex.wordpress.org/Function_Reference/url_to_postid