3
3

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

Wordpressで現在表示しているテンプレートを開発ツールのConsoleに表示する方法

Last updated at Posted at 2018-03-30

#使い方
ログイン時のみ使用しているテンプレートをConsoleに出力してくれます。
footer.php</body>の上に記述するだけで使用できます。

footer.phpでjQueryを読み込んでいるときは、wp_footer()の下に記述してください

footer.php

<?php
  if(is_user_logged_in()):
    global $template;
    echo '<script>console.log("'.$template.'");</script>';
  endif;
?> 

きれいなテンプレート構造にしてあればいらないと思いますが、
外部の会社から引き継いだWordpressのときとかに使うと、開発が楽になるかも。。。?

3
3
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
3
3

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?