public function generateListBlogPostCriterion(Location $location, array $viewParameters, array $languages = array())
    {
        $criteria = array();
        $criteria[] = new Criterion\Visibility(Criterion\Visibility::VISIBLE);
        $criteria[] = new Criterion\Subtree($location->pathString);
        $criteria[] = new Criterion\ContentTypeIdentifier(array('blog_post'));
        $criteria[] = new Criterion\LanguageCode($languages);

        if (!empty($viewParameters)) {
            if (!empty($viewParameters['month']) && !empty($viewParameters['year'])) {
                // Generating the criterion for the given month/year
                $month = (int)$viewParameters['month'];
                $year = (int)$viewParameters['year'];

                $date = new DateTime("$year-$month-01");
                $date->setTime(00, 00, 00);

                $criteria[] = new Criterion\DateMetadata(
                    Criterion\DateMetadata::CREATED,
                    Criterion\Operator::BETWEEN,
                    array(
                        $date->getTimestamp(),
                        $date->add(new DateInterval('P1M'))->getTimestamp(),
                    )
                );
            }
        }

        return new Criterion\LogicalAnd($criteria);
    }