query($sqlA); $resultA = $queryA->fetch_assoc(); $numA = $queryA->num_rows; if($postpage = "page") { $id = $resultA['ID']; } $sqlTitle = "SELECT * FROM ".$prefisso_tabelle."postmeta WHERE post_id = '".$resultA['ID']."' AND meta_key = '_yoast_wpseo_title'"; $queryTitle = $db->query($sqlTitle); while($resultTitle = $queryTitle->fetch_array()) { $title = $resultTitle['meta_value']; } $sqlDescr = "SELECT * FROM ".$prefisso_tabelle."postmeta WHERE post_id = '".$resultA['ID']."' AND meta_key = '_yoast_wpseo_metadesc'"; $queryDescr = $db->query($sqlDescr); while($resultDescr = $queryDescr->fetch_array()) { $descr = $resultDescr['meta_value']; } $sqlCat = "SELECT * FROM ".$prefisso_tabelle."postmeta WHERE post_id = '".$resultA['ID']."' AND meta_key = 'idCategoria'"; $queryCat = $db->query($sqlCat); $resultCat = $queryCat->fetch_array(); $expCan = explode("?",$_SERVER['REQUEST_URI']); $newUrl = preg_replace('/(\/+)/','/',"www.mjwebstudio.co.uk".$expCan[0]); $newUrl = str_replace('%20','',$newUrl); $sqlAF = "SELECT meta_value FROM ".$prefisso_tabelle."postmeta WHERE meta_key = '_thumbnail_id' AND post_id = '".$resultA['ID']."'"; $queryAF = $db->query($sqlAF); $numAF = $queryAF->num_rows; $resultAF = $queryAF->fetch_array(); $sqlAF1 = "SELECT meta_value FROM ".$prefisso_tabelle."postmeta WHERE meta_key = '_wp_attached_file' AND post_id = '".$resultAF['meta_value']."'"; $queryAF1 = $db->query($sqlAF1); $resultAF1 = $queryAF1->fetch_array(); ?> <? if($title!="") { echo formattatitoli($title); } else { echo formattatitoli($resultA['post_title']); } ?> "/>
">

'.formattatitoli($resultA['post_excerpt']).'

'; } else { echo formattatitoli($descr); } } else { $sqlPM = "SELECT meta_value FROM ".$prefisso_tabelle."postmeta WHERE meta_key = 'riassunto' AND post_id = '".$resultA['ID']."'"; $queryPM = $db->query($sqlPM); $numPM = $queryPM->num_rows; if($numPM==1) { $resultPM = $queryPM->fetch_array(); echo formattatitoli($resultPM['meta_value']); } else { echo formattatitoli($descr); } } ?> > '; $pattern2 = '#\[/caption\]#is'; $replacement2 = '
'; $rep1 = preg_replace($pattern,$replacement,$resultA['post_content']); $rep2 = preg_replace($pattern2,$replacement2,$rep1); $dom = new DOMDocument(); $string = mb_convert_encoding($rep2, 'HTML-ENTITIES', "UTF-8"); @$dom->loadHTML($string); $x = new DOMXPath($dom); $conteggio = 0; foreach($x->query("//h2") as $node) { $node->setAttribute("id",$conteggio); $conteggio = $conteggio+1; } $newHtml = $dom->saveHtml(); echo '

'.strip_tags(testo_articolo($newHtml),"


  • "); ?>

    query($sqlCatT); $resultCatT = $queryCatT->fetch_array(); echo "Dal blog: ".$resultCatT['name']; } if($resultA['post_type'] == "post") { echo "Dal blog"; } ?>

    query($sqlA); $conteggio = 0; setlocale(LC_TIME, 'it_IT'); ?>
    fetch_array()) { $conteggio = $conteggio+1; if($conteggio==1) { $classe = "primo_articolo_blog"; } if($conteggio==2) { $classe = "secondo_articolo_blog"; } $sqlMetaDesc = "SELECT * FROM ".$prefisso_tabelle."postmeta WHERE post_id = '".$resultA['ID']."' AND meta_key = '_yoast_wpseo_metadesc'"; $queryMetaDesc = $db->query($sqlMetaDesc); $resultMetaDesc = $queryMetaDesc->fetch_assoc(); $sqlAF = "SELECT meta_value FROM ".$prefisso_tabelle."postmeta WHERE meta_key = '_thumbnail_id' AND post_id = '".$resultA['ID']."'"; $queryAF = $db->query($sqlAF); $numAF = $queryAF->num_rows; $resultAF = $queryAF->fetch_array(); $sqlAF1 = "SELECT meta_value FROM ".$prefisso_tabelle."postmeta WHERE meta_key = '_wp_attached_file' AND post_id = '".$resultAF['meta_value']."'"; $queryAF1 = $db->query($sqlAF1); $resultAF1 = $queryAF1->fetch_array(); ?>
    ".formattatitoli($resultA['post_title']).""; ?>
    ".formattatitoli($resultMetaDesc['meta_value'])."
    "; echo "
    ".utf8_encode(strftime("%A, %d %B %Y, %H:%M",strtotime($resultA['post_date'])))."
    "; echo ""; ?>