當前位置:股票大全官網 - 資訊化咨詢 - 我想在wordpress工具條上添加最新的新聞專欄。

我想在wordpress工具條上添加最新的新聞專欄。

嗯,這取決於妳的主題。

如果妳的主題有小工具特性,

只需在後臺使用小工具將最新文章直接添加到您的邊欄中。

如果妳的主題不支持小工具,

您可以使用高博客提供的最新文章代碼。

代碼如下:

& ltul & gt

& lt?PHP query _ posts(' posts _ per _ page = 10 & amp;caller _ get _ posts = 1’);?& gt

& lt?PHP while(have _ posts()):the _ post();?& gt

& lt李& gt

& lta target = " _ blank " href = " & lt?PHP the _ permalink();?>

title = " & lt?PHP the _ title();?>class="title " >& lt?PHP the _ title();?& gt& lt/a & gt;

& lt/李& gt

& lt?php endwhileWP _ reset _ query();?& gt

& lt/ul & gt;

希望能幫到妳。