Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
フッターにあるウィジェット内の現在の投稿タイトルを取得するにはどうすればよいですか? ループは利用できないと思います。
ショートコードで get_the_title() を試しました。ショートコードをウィジェットに入力すると、出力ではなくショートコード リテラルが表示されます。
WordPressテーマのフッターについて話していると思います...したがって、投稿(single.php)にいる場合、期待どおりに機能します:
$x = get_the_title(); // $x に投稿タイトルの値を割り当てる
タイトル(); // タイトルを直接エコーする