Get content from pages with same meta_key from Database

Your code snippet is full of errors.

  • The serialized string is invalid, it’s only 3 chars instead of 9, unserialization will not work, it will trigger an error.
  • Variables are case sensitive, $red doesn’t exist, it’s $Red, this will trigger an error too.
  • The <?php ?> tags are redundant and invalid since there already must be an opening PHP tag, ofcourse this will also trigger an error.

Also I don’t understand why the meta value being a string should be a problem?

Works fine:

$red = 'a:1:{i:0;s:3:"Red";}';
$red = unserialize($red);

$pages = get_pages(array('meta_key' => 'color', 'meta_value' => $red[0]));
foreach($pages as $page)
{
    echo get_the_post_thumbnail($page->ID, 'thumbnail');
    echo $page->post_title;
    echo $page->post_content;
}