織夢如何獲取與當前短標題一樣有關的文章,織夢
導讀:織夢技術織夢技術在extend.func.php 文件添加一下代碼 /** *dede調取和當前文章短標題相同的文章 */ function s_title($shorttit織夢模板免費織夢模板免費下裁。
在extend.func.php 文件添加一下代碼
/**
*dede調取和當前文章短標題相同的文章
*/
function s_title($shorttitle)
{
$sql = "SELECT a.shorttitle, b.* FROM dede_archives AS a INNER JOIN dede_archives as b ON a.id = b.id WHERE a.shorttitle='$shorttitle';"
$dsql->SetQuery($sql);
$dsql->Execute('t');
dede手機模板
$result = '';
while($row = $dsql->GetArray('t'))
{
$arcrow = GetOneArchive($row['id']);
$row['arcurl'] = $arcrow['arcurl'];
$title = cn_substr($row['title'],8);
$result .= "<a href=\"{$row['arcurldede5.7模板']}\">{$title}</a>";
}
return $result;
}
通過織夢當前文章的短標題獲取相同短短標題的文章
在織夢內容頁調用方法:
{dede:field.shorttitle function="s_title(@me)&qdede手機模板uot;/}相關織夢模板免費織夢模板免費下裁。
聲明: 本文由我的SEOUC技術文章主頁發布于:2023-07-17 ,文章織夢如何獲取與當前短標題一樣有關的文章,織夢主要講述標題,標簽,織夢網站建設源碼以及服務器配置搭建相關技術文章。轉載請保留鏈接: http://www.bifwcx.com/article/web_28746.html