Artigos sobre Psicologia Infantil

9999 );
$myposts = get_posts( $args );

foreach( $myposts as $post ) : setup_postdata($post);
array_push($response, $post);
endforeach;

wp_reset_query();

$pages = get_pages( array( ‘child_of’ => $id, ‘sort_column’ => ‘post_date’, ‘sort_order’ => ‘desc’ ));

foreach($pages as $page) :
array_push($response, $page);
endforeach;

usort($response, ‘mysort’);

echo “

    “;
    foreach($response as $item)
    {
    $text = substr(strip_tags($item->post_content),0,250);
    $val = strrpos($text,” “);

    $description = substr(strip_tags($text), 0, $val).” …”;
    $link = get_permalink($item->ID);

    echo “

  • “;
    // echo “

    {$item->post_title}

    “;
    // if (!empty($item->post_content)) echo “

    {$description}

    “;
    // echo “Leia Mais“;
    echo “{$item->post_title}“;
    echo “

  • “;

    }
    echo “

“;

function mysort($a, $b)
{
return(strtotime($b->post_date) – strtotime($a->post_date));
}

?>