固定ページと投稿ページでアイキャッチ画像の大きさを変えたいとき

固定ページと投稿ページで処理を変えたいと思ったときの話

WordPressで固定ページか投稿ページか判断して、いろいろ変えたいときの条件分岐の関数。

目次

  1. 関数
  2. 使い方
  3. 実際のコード
  4. DEMO

1.関数

投稿ページ
is_single()

2.使い方

3.実際のコード

Simplicity2のテーマではアイキャッチ画像を記事のタイトルの下に表示させるかどうか設定できるのですが、投稿ページと固定ページでアイキャッチ画像の大きさを変えたかったのでいじってみました。

お使いの環境によってアイキャッチ画像を設定しているところは違うと思いますが、
has_post_thumbnail()
the_post_thumbnail()
と記載してある辺りを探してみるといいと思います。

Simplicity2では、子テーマに追加するファイルはentry-eye-catch.php
親テーマからダウンロードしてきて、変更したい部分のみ修正して子テーマにアップロードするといいですね。

4.Demoページ

投稿ページ
固定ページ

コメント

  1. link 12bet より:

    … [Trackback]

    […] Find More here to that Topic: blog.pippuriric.com/wordpress/function1/ […]

  2. … [Trackback]

    […] Here you can find 65358 additional Info on that Topic: blog.pippuriric.com/wordpress/function1/ […]

  3. website here より:

    … [Trackback]

    […] Read More on to that Topic: blog.pippuriric.com/wordpress/function1/ […]

  4. … [Trackback]

    […] Here you can find 21774 more Info on that Topic: blog.pippuriric.com/wordpress/function1/ […]

  5. … [Trackback]

    […] Read More Information here on that Topic: blog.pippuriric.com/wordpress/function1/ […]

  6. casino より:

    … [Trackback]

    […] There you can find 54133 more Information to that Topic: blog.pippuriric.com/wordpress/function1/ […]

  7. … [Trackback]

    […] Find More to that Topic: blog.pippuriric.com/wordpress/function1/ […]

  8. … [Trackback]

    […] Information to that Topic: blog.pippuriric.com/wordpress/function1/ […]

  9. … [Trackback]

    […] Read More on that Topic: blog.pippuriric.com/wordpress/function1/ […]

  10. … [Trackback]

    […] Find More Information here to that Topic: blog.pippuriric.com/wordpress/function1/ […]

  11. didi より:

    … [Trackback]

    […] Find More here on that Topic: blog.pippuriric.com/wordpress/function1/ […]

  12. … [Trackback]

    […] Find More to that Topic: blog.pippuriric.com/wordpress/function1/ […]

  13. Firefighting より:

    … [Trackback]

    […] Find More Info here on that Topic: blog.pippuriric.com/wordpress/function1/ […]

  14. … [Trackback]

    […] Find More here to that Topic: blog.pippuriric.com/wordpress/function1/ […]

  15. … [Trackback]

    […] Here you can find 57528 additional Information on that Topic: blog.pippuriric.com/wordpress/function1/ […]

  16. … [Trackback]

    […] Here you will find 6040 more Information to that Topic: blog.pippuriric.com/wordpress/function1/ […]

  17. jasaqq より:

    … [Trackback]

    […] Read More to that Topic: blog.pippuriric.com/wordpress/function1/ […]

  18. pelangiqq より:

    … [Trackback]

    […] Read More on that Topic: blog.pippuriric.com/wordpress/function1/ […]

  19. … [Trackback]

    […] Info on that Topic: blog.pippuriric.com/wordpress/function1/ […]

  20. … [Trackback]

    […] There you will find 14399 additional Info on that Topic: blog.pippuriric.com/wordpress/function1/ […]

  21. … [Trackback]

    […] Read More here on that Topic: blog.pippuriric.com/wordpress/function1/ […]

  22. … [Trackback]

    […] There you will find 89909 additional Info on that Topic: blog.pippuriric.com/wordpress/function1/ […]

  23. rajaqq より:

    … [Trackback]

    […] Info to that Topic: blog.pippuriric.com/wordpress/function1/ […]

  24. vegus168 より:

    … [Trackback]

    […] Find More Info here on that Topic: blog.pippuriric.com/wordpress/function1/ […]

  25. beauty より:

    … [Trackback]

    […] Find More on on that Topic: blog.pippuriric.com/wordpress/function1/ […]

  26. … [Trackback]

    […] Find More Info here to that Topic: blog.pippuriric.com/wordpress/function1/ […]

  27. … [Trackback]

    […] Read More on that Topic: blog.pippuriric.com/wordpress/function1/ […]

  28. w888 より:

    … [Trackback]

    […] Info to that Topic: blog.pippuriric.com/wordpress/function1/ […]

  29. … [Trackback]

    […] Read More to that Topic: blog.pippuriric.com/wordpress/function1/ […]

  30. … [Trackback]

    […] Info to that Topic: blog.pippuriric.com/wordpress/function1/ […]

  31. … [Trackback]

    […] Find More Information here on that Topic: blog.pippuriric.com/wordpress/function1/ […]

  32. … [Trackback]

    […] Information to that Topic: blog.pippuriric.com/wordpress/function1/ […]

  33. crypto より:

    … [Trackback]

    […] Find More Information here to that Topic: blog.pippuriric.com/wordpress/function1/ […]

  34. … [Trackback]

    […] Find More to that Topic: blog.pippuriric.com/wordpress/function1/ […]

  35. meja qq より:

    … [Trackback]

    […] Find More to that Topic: blog.pippuriric.com/wordpress/function1/ […]

  36. didi より:

    … [Trackback]

    […] Read More on that Topic: blog.pippuriric.com/wordpress/function1/ […]

  37. … [Trackback]

    […] Find More on that Topic: blog.pippuriric.com/wordpress/function1/ […]

  38. … [Trackback]

    […] Info on that Topic: blog.pippuriric.com/wordpress/function1/ […]

  39. TorSearch onion より:

    … [Trackback]

    […] Find More here to that Topic: blog.pippuriric.com/wordpress/function1/ […]

  40. … [Trackback]

    […] Read More Information here to that Topic: blog.pippuriric.com/wordpress/function1/ […]

  41. … [Trackback]

    […] Read More here to that Topic: blog.pippuriric.com/wordpress/function1/ […]

  42. … [Trackback]

    […] There you will find 27030 additional Information to that Topic: blog.pippuriric.com/wordpress/function1/ […]

  43. w88 indonesia より:

    … [Trackback]

    […] Find More on on that Topic: blog.pippuriric.com/wordpress/function1/ […]

  44. … [Trackback]

    […] Find More on to that Topic: blog.pippuriric.com/wordpress/function1/ […]

  45. … [Trackback]

    […] Info on that Topic: blog.pippuriric.com/wordpress/function1/ […]

  46. www.w88th より:

    … [Trackback]

    […] Information on that Topic: blog.pippuriric.com/wordpress/function1/ […]

  47. fun88.com より:

    … [Trackback]

    […] There you can find 88707 additional Information to that Topic: blog.pippuriric.com/wordpress/function1/ […]

  48. fun78.com より:

    … [Trackback]

    […] There you will find 93763 additional Info to that Topic: blog.pippuriric.com/wordpress/function1/ […]