Me pehea te taapiri i te URL o tenei tuhinga ki te mutunga o te tuhinga WordPress WP hono taketake waehere PHP

Me pehea kiWordPressTāpiri hono ki te tuhinga taketake ki te mutunga o ia tuhinga i roto?

Me pehea te taapiri i te URL o tenei tuhinga ki te mutunga o te tuhinga WordPress WP hono taketake waehere PHP

whakamahipaetukutuku WordPresshoa o , ki te hiahia koe ki te taapiri "Mena ka tukuna te tuhinga taketake, tohuhia te hono ki tenei tuhinga:”, he tino ngawari.

Anei nga huarahi e 2 hei taapiri i tetahi URL hono ki tenei tuhinga i te mutunga o to panui WordPress.

?Tuatahi, whakarereke i te tauira wharangi tuhinga single.php

I roto i te konae tauira kaupapa kaupapa WordPress, whakatuwheratia te single.php ka rapua te waehere PHP e whai ake nei:

<?php the_content(); ?>

Ki raro i tenei rarangi o te waehere PHP, taapirihia te waehere PHP e whai ake nei▼

<p>原创文章如转载,请注明本文链接: <a href="<?php the_permalink() ?>" title="<?php the_title(); ?>"><?php the_permalink(); ?></a></p>
  • Na, tiakina te whakahou me te mea.

?‍?Tuarua, taapirihia te waehere PHP ki te konae function.php

E taunaki ana tenei tikanga, ehara i te mea hei taapiri hononga ki nga whaarangi rangitaki rangitaki, engari me whakauru ano hoki nga whangai.

Whakatuwheratia te kōnae function.php ki te kōpaki kaupapa ka taapirihia te waehere PHP e whai ake nei i te mutunga (whakatuwherahia te tohu Hainamana me te reo Ingarihi ina kape me te whakapiri):

<?php
function feed_copyright($content) {
if(is_single() or is_feed() or is_page()) {
$content.= '<div>    » 本文来自:<a title="陈沩亮博客" href="https://www.chenweiliang.com/" target="_blank">陈沩亮博客</a> » <a rel="bookmark" title="'.get_the_title().'" href="'.get_permalink().'" target="_blank">《'.get_the_title().'》</a></div>';
$content.= '<div>    » 本文链接地址:<a rel="bookmark" title="'.get_the_title().'" href="'.get_permalink().'" target="_blank">'.get_permalink().'</a> »英雄不问来路,转载请注明出处,谢谢。</div>';
$content.= '<div>    » 有话想说:<a title="给我留言" href="'.get_permalink().'#respond" target="_blank">那就赶紧去给我留言吧.</a></div>';
$content.= '<div>    » 欢迎加入陈沩亮博客的 Telegram 频道:<a rel="external nofollow" title="点此加入陈沩亮博客的 Telegram 频道" href="" target="_blank">https://www.chenweiliang.com/go/tgchannel</a></div>';
}
return $content;
}
add_filter ('the_content', 'feed_copyright');
?>
  • Tena koa whakarereketia kia rite ki to rangitaki WordPress.

Hope Chen Weiliang Blog ( https://www.chenweiliang.com/ ) shared "Me pehea te taapiri i te URL o tenei tuhinga ki te mutunga o te tuhinga WordPress? WP hono taketake waehere PHP", he pai ki a koe.

Nau mai ki te tohatoha i te hono o tenei tuhinga:https://www.chenweiliang.com/cwl-1498.html

Nau mai ki te hongere Telegram o te blog a Chen Weiliang ki te tiki i nga korero hou!

🔔 Ko koe te tuatahi ki te tiki i te "ChatGPT Content Marketing AI Tool Usage Guide" i roto i te raarangi o runga hongere! 🌟
📚 He uara nui tenei aratohu, 🌟He waahi onge tenei, kaua e ngaro! ⏰⌛💨
Tohaina me te pai ki te pai koe!
Ko to tiritiri me o hiahia ko to maatau hihiri tonu!

 

发表 评论

Kaore e tukuna to wahitau imeera. 必填 项 已 用 * Tapanga

panuku ki runga