【WordPress】フロントページ

トップページには何を記載するのかを考えるページです。

参考(キラキラ):https://himebaba.com/

こちらの参考HPでは投稿した記事をアイキャッチのアイコンとバナー形式の記事を載せています。

’24/08/25現在はHPを開設したてであり、フロントページではサイトの内容紹介しか載せていませんでした。

フロントページに投稿を自動で表示してくれるプラグインを探してみることにします。

■What’s New Generator

参考(公式):https://ja.wordpress.org/plugins/whats-new-genarator/#description

こちらのプラグインは7年前から更新が止まっており、代替を検討する必要があるようです。(‘24.08.25時点)

参考(代替参考):https://xn--ecka7j.biz/site-operation/wordpress/9937/

■Newpost Catch

参考(公式):https://wordpress.org/plugins/newpost-catch

(‘24.08.25時点)

記事:https://nuko-blog.net/wordpress-newarticle-plugin/

こちらの記事を参考に設定できるようです。

為にしにインストールしてみたいと思います。

Newpost Catchのショートコードとパラメーター

[npc]

デフォルトの表示結果としては下記のように投稿した5つの記事が表示されるようになりました。

パラメータを設定することで細かく設定ができるようになります。

公式(パラメータ):https://wordpress.org/plugins/newpost-catch/#parameter

  • id(string) – Name of the id attribute “ul” element(default:npcatch)
  • id (string)<ul> 要素の id 属性名を指定します。(デフォルト: npcatch
  • post_type(string) – Use post types. Retrieves posts by Post Types(default:post)
  • post_type (string) – 投稿タイプを使用します。指定した投稿タイプの投稿を取得します。(デフォルト: post
  • cat(int) – Use category id(default:NULL)
  • cat (int) – カテゴリーIDを指定します。(デフォルト: NULL)
  • width(int) – Thumbnail width px(default:10)
  • width (int) – サムネイルの幅をピクセル単位で指定します。(デフォルト: 10)
  • height(int) – Thumbnail height px(default:10)
  • height (int) – サムネイルの高さをピクセル単位で指定します。(デフォルト: 10)
  • posts_per_page(int) – Number of post to show per page(default:5)
  • posts_per_page (int) – 1ページに表示する投稿数を指定します。(デフォルト: 5)
  • sticky(boolean) – Sticky posts or not(on:1 off:0 default:0)
  • sticky (boolean) – 固定表示する投稿かどうかを指定します。(オン: 1、オフ: 0、デフォルト: 0)
  • offset(int) – Number of post to displace or pass over(default:0)
  • offset (int) – 取得する投稿をどれだけスキップするかを指定します。(デフォルト: 0)
  • orderby(string) – Sort retrieved posts by parameter(default:date)
  • orderby (string) – 投稿を並べ替えるパラメータを指定します。(デフォルト: date
  • order(string) – Designates the ascending or descending order of the ‘orderby’ parameter(default:DESC)
  • order (string) – 並べ替えパラメータの昇順または降順を指定します。(デフォルト: DESC
  • date(boolean) – Display date(on:1 off:0 default:0)
  • date (boolean) – 投稿日を表示するかどうかを指定します。(オン: 1、オフ: 0、デフォルト: 0)
  • dynamic(boolean) – Show only articles in the same category as the article being displayed. If you specify both “cat” parameters, “dynamic” priority(on:1 off:0 default:0)
  • dynamic (boolean) – 表示されている記事と同じカテゴリの記事のみを表示します。cat パラメータが指定されている場合でも、この dynamic パラメータが優先されます。(オン: 1、オフ: 0、デフォルト: 0)
  • Example1. Want change id name of ul element.
  • 例1. <ul> 要素の id 名を変更する場合

  • Example2. Show only articles in the same category as the article being displayed.(post_type is “post” only. and is_single() == true )
    When the post other than, post_type of the current page is the value of the priority parameter cat
  • 例2. 表示されている記事と同じカテゴリの記事のみを表示する場合(post_typepost のみ。is_single()true の場合)

参考記事:https://poppyou.com/newpostcatch.html

■Easy Updates Manager (バージョン: 9.0.18)

表示用:【WordPress】フロントページhttps://vtubergalaxy.com/2024/08/25/wordpress%e3%83%95%e3%83%ad%e3%83%b3%e3%83%88%e3%83%9a%e3%83%bc%e3%82%b8/

編集用:https://vtubergalaxy.com/wp-admin/post.php?post=176&action=edit

コメント

タイトルとURLをコピーしました