I’m stuck on a code to display meta discriptions for more then one html pages.
this code displays three time one meta description, I want 2 display 3 difirent meta’s. What do I wrong?
[php]
$kfamily = is_page(683);
if ($kfamily && get_children(93518)):
$html = file_get_contents_curl(“https://”.$_SERVER[‘HTTP_HOST’].$URL[‘PATH’]."/kenfam_00/");
endif;
if ($kfamily && get_children(93520)):
$html = file_get_contents_curl(“https://”.$_SERVER[‘HTTP_HOST’].$URL[‘PATH’]."/kenfam_01/");
endif;
if ($kfamily && get_children(93522)):
$html = file_get_contents_curl(“https://”.$_SERVER[‘HTTP_HOST’].$URL[‘PATH’]."/kenfam_02/");
endif;
$doc = new DOMDocument();
@$doc->loadHTML($html);
$nodes = $doc->getElementsByTagName(‘title’);
$title = $nodes->item(0)->nodeValue;
$metas = $doc->getElementsByTagName(‘meta’);
for ($i = 0; $i < $metas->length; $i++)
{
$meta = $metas->item($i);
if($meta->getAttribute(‘name’) == ‘description’)
$description = $meta->getAttribute(‘content’);
}
$list_pages_html .= ‘
[/php]