Articulu Directory
CumuWordPressAghjunghjite un ligame à u testu originale à a fine di ogni articulu in?

使用U situ di WordPressamichi di , se vulete aghjunghje "Se l'articulu originale hè ripruduciutu, indicate u ligame à questu articulu:", chì in realtà hè abbastanza simplice.
Eccu 2 modi per aghjunghje un URL di ligame à questu articulu à a fine di u vostru postu di WordPress.
??Prima, mudificà u mudellu di pagina di l'articulu single.php
In u schedariu di u mudellu di u tema di WordPress, apre single.php è cercate u codice PHP seguente:
<?php the_content(); ?>
Sottu sta linea di codice PHP, aghjunghje u seguente codice PHP▼
<p>原创文章如转载,请注明本文链接: <a href="<?php the_permalink() ?>" title="<?php the_title(); ?>"><?php the_permalink(); ?></a></p>
- Allora, salvate l'aghjurnamentu è basta.
??Secunna, aghjunghje u codice PHP à u schedariu function.php
Stu metudu hè cunsigliatu, micca solu per aghjunghje ligami à e pagine di logu di blog, ma ancu per include i feed.
Apertura u schedariu function.php in u cartulare di u tema è aghjunghje u seguente codice PHP à a fine (nota a puntuazione cinese è inglese quandu copia è incollà):
<?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'); ?>
- Per piacè mudificà secondu u vostru blog di WordPress.
Hope Chen Weiliang Blog ( https://www.chenweiliang.com/ ) sparte "Cumu aghjunghje l'URL di questu articulu à a fine di un articulu di WordPress? WP uriginale link PHP code ", chì hè utile per voi.
Benvenuti à sparte u ligame di stu articulu:https://www.chenweiliang.com/cwl-1498.html
