次のコラム WordPress チュートリアル では、WordPress 記事の最後に著者情報ボックスを自動的に追加する方法を紹介します。 !
記事の著者に関する関連情報を WordPress 記事の最後に追加する場合は、次のようにします。コードは記事の「著者情報ボックスを追加」に簡単に含めることができます。
コードを現在のテーマのfunctions.phpに追加します:
function wp_author_info_box( $content ) { global $post; // 检测文章与文章作者 if ( is_single() && isset( $post->post_author ) ) { // 获取作者名称 $display_name = get_the_author_meta( 'display_name', $post->post_author ); // 如果没有名称,使用昵称 if ( empty( $display_name ) ) $display_name = get_the_author_meta( 'nickname', $post->post_author ); // 作者的个人信息 $user_description = get_the_author_meta( 'user_description', $post->post_author ); // 获取作者的网站 $user_website = get_the_author_meta('url', $post->post_author); // 作者存档页面链接 $user_posts = get_author_posts_url( get_the_author_meta( 'ID' , $post->post_author)); if ( ! empty( $display_name ) ) $author_details = '<div class="author-name">关于 ' . $display_name . '</div>'; if ( ! empty( $user_description ) ) // 作者头像 $author_details .= '<div class="author-details">' . get_avatar( get_the_author_meta('user_email') , 90 ) . nl2br( $user_description ). '</div>'; $author_details .= '<div class="author-links"><a href="'. $user_posts .'">查看 ' . $display_name . ' 所有文章</a>'; // 检查作者在个人资料中是否填写了网站 if ( ! empty( $user_website ) ) { // 显示作者的网站链接 $author_details .= ' | <a href="' . $user_website .'" target="_blank" rel="nofollow">网站</a></div>'; } else { // 如果作者没有填写网站则不显示网站链接 $author_details .= '</div>'; } // 在文章后面添加作者信息 $content = $content . '<footer class="author-bio-section" >' . $author_details . '</footer>'; } return $content; } // 添加过滤器 add_action( 'the_content', 'wp_author_info_box' ); // 允许HTML remove_filter('pre_user_description', 'wp_filter_kses'); 再将配套的CSS添加到主题样式文件style.css中: .author-bio-section { background: #fff; float: left; width: 100%; margin: 10px 0; padding: 15px; border: 1px dashed #ccc; } .author-name { font-size: 15px; font-weight: bold; margin: 0 0 5px 0; } .author-details img { float: left; width: 48px; height: auto; margin: 5px 15px 0 0; }
以上がWordPress 投稿の最後に著者情報ボックスを自動的に追加する方法の詳細内容です。詳細については、PHP 中国語 Web サイトの他の関連記事を参照してください。

tosecureawwordpresssite、soflowthesesteps:1)定期的にwordpresscore、themes、およびpluginstopatchvulnerabilities.2)usestrong、usestrong、usestrong、sonsandenabletototothentication.3)optformanagedagedwordpresshosting arehoredhoredhoredhored hosting withebapplicationfirewaal

wordpressexexexexexcelsoverwebsitebuildersduetoits ffficability、scalability、andopen-sourcenature.1)それは、aversatilecmswitextensive sustomizationoptionsviathemesandplugins.2)その学習中心部のスチッピアベッタービューターフルフルフルフルフルフルフルカンセーズ。3)

2025年のウェブサイト開発のための7つの必須ワードプレスプラグイン 2025年に一流のWordPress Webサイトを構築するには、速度、応答性、およびスケーラビリティが必要です。 これを効率的に達成することは、しばしば戦略的なプラグインの選択にかかっています。 この記事Highlig

wordpresscanbeusedpurposesbeyondblogging.1)e-ocommerce:withwoocommerce、itcanbecomeafulloninestore.2)メンバーシップサイト:Pluginslikememberpressenable clusivecontentareas.3)ポートフォリオソイト:ThemeslikeasieasiestraololowStunnningStunnningStunnningStunnningStuntunnneDayOutssuntunnneaTuntunnnedrayOutuntuntuntunnnedraySuts

はい、wordpressisexcellentforcreatingportfoliowebsite.1)itoffers numersportfolio cilems like'astra'astra'foreasycustomization.2)プラグインエレメントレメントレディングの装飾、思想的な態度環境を

wordpressisadvasteousovercodingawebsitefromscratchdueto:1)easeofuseandfasterdevelopment、2)柔軟性と吸収性、3)strongCommunitySupport、4)組み込みインセンアンドマークティングツール、5)費用対効果、6)レシュリティアップデート

wordpressisacmsduetoitseaseaseofuse、customization、usermanagement、seo、andcommunitysupport.1)ofssextensiveationization throughthemesandplugins.3)ofsiscontensiveativeizationization withintentmanagement withintententmanagement with inting ustomization.3)revisustusersandpermissions.4)拡張型を提供します

WordPress Webサイトでコメントを有効にして、訪問者にディスカッションに参加し、フィードバックを共有するプラットフォームを提供します。これを行うには、次の手順に従ってください。コメントを有効にします。ダッシュボードで、設定に移動してgt;議論し、[コメントを許可]チェックボックスを選択します。コメントフォームの作成:エディターで、[ブロックの追加]をクリックし、コメントブロックを検索してコンテンツに追加します。カスタムコメントフォーム:タイトル、ラベル、プレースホルダー、ボタンテキストを設定して、コメントブロックをカスタマイズします。変更を保存します:[更新]をクリックしてコメントボックスを保存し、ページまたは記事に追加します。


ホットAIツール

Undresser.AI Undress
リアルなヌード写真を作成する AI 搭載アプリ

AI Clothes Remover
写真から衣服を削除するオンライン AI ツール。

Undress AI Tool
脱衣画像を無料で

Clothoff.io
AI衣類リムーバー

Video Face Swap
完全無料の AI 顔交換ツールを使用して、あらゆるビデオの顔を簡単に交換できます。

人気の記事

ホットツール

メモ帳++7.3.1
使いやすく無料のコードエディター

SublimeText3 Linux 新バージョン
SublimeText3 Linux 最新バージョン

WebStorm Mac版
便利なJavaScript開発ツール

MinGW - Minimalist GNU for Windows
このプロジェクトは osdn.net/projects/mingw に移行中です。引き続きそこでフォローしていただけます。 MinGW: GNU Compiler Collection (GCC) のネイティブ Windows ポートであり、ネイティブ Windows アプリケーションを構築するための自由に配布可能なインポート ライブラリとヘッダー ファイルであり、C99 機能をサポートする MSVC ランタイムの拡張機能が含まれています。すべての MinGW ソフトウェアは 64 ビット Windows プラットフォームで実行できます。

PhpStorm Mac バージョン
最新(2018.2.1)のプロフェッショナル向けPHP統合開発ツール

ホットトピック









