[
  {
    "id": 3622,
    "title": "投稿リスト_P-37",
    "icon": "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"24\" height=\"24\" viewbox=\"0 0 256 256\"><path d=\"M216,64V192H88V64Z\" fill=\"#9aa8c9\"/><path d=\"M80,64a8,8,0,0,1,8-8H216a8,8,0,0,1,0,16H88A8,8,0,0,1,80,64Zm136,56H88a8,8,0,1,0,0,16H216a8,8,0,0,0,0-16Zm0,64H88a8,8,0,1,0,0,16H216a8,8,0,0,0,0-16ZM44,52A12,12,0,1,0,56,64,12,12,0,0,0,44,52Zm0,64a12,12,0,1,0,12,12A12,12,0,0,0,44,116Zm0,64a12,12,0,1,0,12,12A12,12,0,0,0,44,180Z\" fill=\"#1a1a2e\"/></svg>",
    "keywords": [
      "投稿リスト",
      "post list",
      "記事一覧",
      "カテゴリ",
      "レイアウト・デザイン"
    ],
    "slug": "lazyblock/f-post-list-pro",
    "description": "指定したカテゴリの投稿を自動的に一覧表示するブロックです。アイキャッチが無い投稿は本文内の画像を表示し、列数・並び順・続きを読むリンクにも対応しています。",
    "category": "Lazyblocks Pro",
    "category_label": "Lazyblocks Pro",
    "supports": {
      "customClassName": true,
      "anchor": false,
      "html": false,
      "multiple": true,
      "inserter": true,
      "reusable": true,
      "color": false,
      "layout": false,
      "shadow": false,
      "spacing": false,
      "dimensions": false,
      "typography": false,
      "lock": true,
      "align": [
        "wide",
        "full"
      ],
      "ghostkit": {
        "effects": false,
        "position": false,
        "spacings": false,
        "frame": false,
        "transform": false,
        "customCSS": false,
        "display": false,
        "attributes": false
      }
    },
    "controls": {
      "control_878bf27153": {
        "type": "panel",
        "name": "",
        "default": "",
        "label": "取得条件",
        "help": "",
        "child_of": "",
        "placement": "inspector",
        "group": "settings",
        "width": "100",
        "hide_if_not_selected": "false",
        "required": "false",
        "translate": "false",
        "save_in_meta": "false",
        "save_in_meta_name": "",
        "placeholder": "",
        "characters_limit": "",
        "icon": "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"24\" height=\"24\" viewbox=\"0 0 256 256\" fill=\"#dbea88\"><path d=\"M216,64V192H88V64Z\" opacity=\"0.2\"/><path d=\"M80,64a8,8,0,0,1,8-8H216a8,8,0,0,1,0,16H88A8,8,0,0,1,80,64Zm136,56H88a8,8,0,1,0,0,16H216a8,8,0,0,0,0-16Zm0,64H88a8,8,0,1,0,0,16H216a8,8,0,0,0,0-16ZM44,52A12,12,0,1,0,56,64,12,12,0,0,0,44,52Zm0,64a12,12,0,1,0,12,12A12,12,0,0,0,44,116Zm0,64a12,12,0,1,0,12,12A12,12,0,0,0,44,180Z\"/></svg>",
        "initial_open": "true",
        "endpoint": "false"
      },
      "control_63dba0c1f5": {
        "type": "taxonomy",
        "name": "post_category",
        "default": "",
        "label": "カテゴリ",
        "help": "",
        "child_of": "",
        "placement": "inspector",
        "group": "settings",
        "width": "100",
        "hide_if_not_selected": "false",
        "required": "false",
        "translate": "false",
        "save_in_meta": "false",
        "save_in_meta_name": "",
        "placeholder": "",
        "characters_limit": "",
        "taxonomy": "category",
        "taxonomy_appearance": "",
        "taxonomy_output_format": "",
        "multiple": "false"
      },
      "control_83fcf7fe27": {
        "type": "number",
        "name": "post_count",
        "default": 6,
        "label": "表示件数",
        "help": "",
        "child_of": "",
        "placement": "inspector",
        "group": "settings",
        "width": "100",
        "hide_if_not_selected": "false",
        "required": "false",
        "translate": "false",
        "save_in_meta": "false",
        "save_in_meta_name": "",
        "placeholder": "",
        "characters_limit": "",
        "min": 1,
        "max": 24,
        "step": 1
      },
      "control_11d0a398c5": {
        "type": "select",
        "name": "post_order",
        "default": "new",
        "label": "並び順",
        "help": "",
        "child_of": "",
        "placement": "inspector",
        "group": "settings",
        "width": "100",
        "hide_if_not_selected": "false",
        "required": "false",
        "translate": "false",
        "save_in_meta": "false",
        "save_in_meta_name": "",
        "placeholder": "",
        "characters_limit": "",
        "choices": [
          {
            "label": "新しい順",
            "value": "new"
          },
          {
            "label": "古い順",
            "value": "old"
          },
          {
            "label": "コメントが多い順",
            "value": "popular"
          },
          {
            "label": "ランダム",
            "value": "random"
          }
        ],
        "allow_null": "false",
        "multiple": "false",
        "output_format": ""
      },
      "control_dbd9ba5a99": {
        "type": "panel",
        "name": "",
        "default": "",
        "label": "表示スタイル",
        "help": "",
        "child_of": "",
        "placement": "inspector",
        "group": "settings",
        "width": "100",
        "hide_if_not_selected": "false",
        "required": "false",
        "translate": "false",
        "save_in_meta": "false",
        "save_in_meta_name": "",
        "placeholder": "",
        "characters_limit": "",
        "icon": "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"24\" height=\"24\" viewbox=\"0 0 256 256\" fill=\"#dbea88\"><path d=\"M216,64V192H88V64Z\" opacity=\"0.2\"/><path d=\"M80,64a8,8,0,0,1,8-8H216a8,8,0,0,1,0,16H88A8,8,0,0,1,80,64Zm136,56H88a8,8,0,1,0,0,16H216a8,8,0,0,0,0-16Zm0,64H88a8,8,0,1,0,0,16H216a8,8,0,0,0,0-16ZM44,52A12,12,0,1,0,56,64,12,12,0,0,0,44,52Zm0,64a12,12,0,1,0,12,12A12,12,0,0,0,44,116Zm0,64a12,12,0,1,0,12,12A12,12,0,0,0,44,180Z\"/></svg>",
        "initial_open": "false",
        "endpoint": "false"
      },
      "control_bcb403a3da": {
        "type": "select",
        "name": "post_columns",
        "default": "3",
        "label": "列数",
        "help": "",
        "child_of": "",
        "placement": "inspector",
        "group": "settings",
        "width": "100",
        "hide_if_not_selected": "false",
        "required": "false",
        "translate": "false",
        "save_in_meta": "false",
        "save_in_meta_name": "",
        "placeholder": "",
        "characters_limit": "",
        "choices": [
          {
            "label": "2列",
            "value": "2"
          },
          {
            "label": "3列",
            "value": "3"
          },
          {
            "label": "4列",
            "value": "4"
          }
        ],
        "allow_null": "false",
        "multiple": "false",
        "output_format": ""
      },
      "control_fac3c86f6a": {
        "type": "toggle",
        "name": "post_show_thumb",
        "default": "true",
        "label": "画像を表示",
        "help": "アイキャッチ画像が無い投稿では、本文内の最初の画像を代わりに表示します。",
        "child_of": "",
        "placement": "inspector",
        "group": "settings",
        "width": "100",
        "hide_if_not_selected": "false",
        "required": "false",
        "translate": "false",
        "save_in_meta": "false",
        "save_in_meta_name": "",
        "placeholder": "",
        "characters_limit": ""
      },
      "control_9e9205eb98": {
        "type": "toggle",
        "name": "post_show_excerpt",
        "default": "true",
        "label": "抜粋を表示",
        "help": "",
        "child_of": "",
        "placement": "inspector",
        "group": "settings",
        "width": "100",
        "hide_if_not_selected": "false",
        "required": "false",
        "translate": "false",
        "save_in_meta": "false",
        "save_in_meta_name": "",
        "placeholder": "",
        "characters_limit": ""
      },
      "control_2a0bad7e81": {
        "type": "toggle",
        "name": "post_show_more_link",
        "default": "true",
        "label": "「続きを読む」リンクを表示",
        "help": "",
        "child_of": "",
        "placement": "inspector",
        "group": "settings",
        "width": "100",
        "hide_if_not_selected": "false",
        "required": "false",
        "translate": "false",
        "save_in_meta": "false",
        "save_in_meta_name": "",
        "placeholder": "",
        "characters_limit": ""
      },
      "control_a626258321": {
        "type": "text",
        "name": "post_more_label",
        "default": "続きを読む",
        "label": "「続きを読む」ラベル文言",
        "help": "",
        "child_of": "",
        "placement": "inspector",
        "group": "settings",
        "width": "100",
        "hide_if_not_selected": "false",
        "required": "false",
        "translate": "false",
        "save_in_meta": "false",
        "save_in_meta_name": "",
        "placeholder": "続きを読む",
        "characters_limit": ""
      },
      "control_6bff8fd403": {
        "type": "toggle",
        "name": "post_show_archive_link",
        "default": "false",
        "label": "末尾にカテゴリ一覧へのリンクを表示",
        "help": "",
        "child_of": "",
        "placement": "inspector",
        "group": "settings",
        "width": "100",
        "hide_if_not_selected": "false",
        "required": "false",
        "translate": "false",
        "save_in_meta": "false",
        "save_in_meta_name": "",
        "placeholder": "",
        "characters_limit": ""
      }
    },
    "code": {
      "output_method": "php",
      "editor_html": "",
      "editor_callback": "",
      "frontend_html": "<?php\n$category_slug = $attributes['post_category'] ?? '';\n$count         = ! empty( $attributes['post_count'] ) ? (int) $attributes['post_count'] : 6;\n$columns       = ! empty( $attributes['post_columns'] ) ? (int) $attributes['post_columns'] : 3;\n$order         = $attributes['post_order'] ?? 'new';\n$show_thumb    = ! empty( $attributes['post_show_thumb'] );\n$show_excerpt  = ! empty( $attributes['post_show_excerpt'] );\n$show_more     = ! empty( $attributes['post_show_more_link'] );\n$more_label    = ! empty( $attributes['post_more_label'] ) ? $attributes['post_more_label'] : '続きを読む';\n$show_archive  = ! empty( $attributes['post_show_archive_link'] );\n\n$query_args = array(\n\t'posts_per_page' => $count,\n\t'post_status'    => 'publish',\n);\n\nswitch ( $order ) {\n\tcase 'old':\n\t\t$query_args['orderby'] = 'date';\n\t\t$query_args['order']   = 'ASC';\n\t\tbreak;\n\tcase 'popular':\n\t\t$query_args['orderby'] = 'comment_count';\n\t\t$query_args['order']   = 'DESC';\n\t\tbreak;\n\tcase 'random':\n\t\t$query_args['orderby'] = 'rand';\n\t\tbreak;\n\tdefault:\n\t\t$query_args['orderby'] = 'date';\n\t\t$query_args['order']   = 'DESC';\n}\n\nif ( $category_slug ) {\n\t$query_args['category_name'] = $category_slug;\n}\n\n$posts_query = new WP_Query( $query_args );\n?>\n<?php if ( $posts_query->have_posts() ) : ?>\n<div class=\"post-list-wrapper\">\n\t<div class=\"post-list-block post-list-cols-<?php echo esc_attr( $columns ); ?>\">\n\t\t<?php while ( $posts_query->have_posts() ) : $posts_query->the_post();\n\t\t\t$thumb_url = '';\n\t\t\tif ( $show_thumb ) {\n\t\t\t\tif ( has_post_thumbnail() ) {\n\t\t\t\t\t$thumb_url = get_the_post_thumbnail_url( get_the_ID(), 'medium' );\n\t\t\t\t} else {\n\t\t\t\t\t$raw_content = get_the_content();\n\t\t\t\t\tif ( preg_match( '/<img[^>]+src=[\"\\']([^\"\\']+)[\"\\']/i', $raw_content, $matches ) ) {\n\t\t\t\t\t\t$thumb_url = $matches[1];\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t?>\n\t\t\t<div class=\"post-list-item\">\n\t\t\t\t<a href=\"<?php the_permalink(); ?>\" class=\"post-list-link\">\n\t\t\t\t\t<?php if ( $thumb_url ) : ?>\n\t\t\t\t\t\t<div class=\"post-list-thumb\">\n\t\t\t\t\t\t\t<img src=\"<?php echo esc_url( $thumb_url ); ?>\" alt=\"\" loading=\"lazy\">\n\t\t\t\t\t\t</div>\n\t\t\t\t\t<?php endif; ?>\n\t\t\t\t\t<div class=\"post-list-body\">\n\t\t\t\t\t\t<p class=\"post-list-title\"><?php the_title(); ?></p>\n\t\t\t\t\t\t<?php if ( $show_excerpt ) : ?>\n\t\t\t\t\t\t\t<p class=\"post-list-excerpt\"><?php echo esc_html( wp_trim_words( get_the_excerpt(), 40 ) ); ?></p>\n\t\t\t\t\t\t<?php endif; ?>\n\t\t\t\t\t\t<?php if ( $show_more ) : ?>\n\t\t\t\t\t\t\t<span class=\"post-list-more\"><?php echo esc_html( $more_label ); ?> &rarr;</span>\n\t\t\t\t\t\t<?php endif; ?>\n\t\t\t\t\t</div>\n\t\t\t\t</a>\n\t\t\t</div>\n\t\t<?php endwhile; ?>\n\t</div>\n\t<?php\n\tif ( $show_archive && $category_slug ) :\n\t\t$term_link = get_term_link( $category_slug, 'category' );\n\t\tif ( ! is_wp_error( $term_link ) ) :\n\t?>\n\t\t<div class=\"post-list-archive-link\">\n\t\t\t<a href=\"<?php echo esc_url( $term_link ); ?>\">このカテゴリの記事をもっと見る &rarr;</a>\n\t\t</div>\n\t<?php\n\t\tendif;\n\tendif;\n\twp_reset_postdata();\n\t?>\n</div>\n<style>\n.post-list-wrapper, .post-list-wrapper * { box-sizing: border-box; }\n.post-list-wrapper { width: 100%; max-width: 100%; }\n.post-list-block { display: grid; gap: 16px; margin: 24px 0; width: 100%; }\n/* Grid blowout対策：素の1frではなくminmax(0, 1fr)にして、\n   中の画像の実寸でグリッドが親要素の幅を超えて広がらないようにする。 */\n.post-list-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }\n.post-list-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }\n.post-list-cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }\n\n/* 投稿カード（ホバーで浮き上がるアニメーション） */\n.post-list-item { \n\tbackground: #111622; \n\tborder-radius: 8px; \n\toverflow: hidden; \n\tmin-width: 0; \n\ttransition: transform 0.3s ease, box-shadow 0.3s ease;\n}\n.post-list-item:hover {\n\ttransform: translateY(-4px);\n\tbox-shadow: 0 8px 16px rgba(0, 0, 0, 0.4);\n}\n\n.post-list-link { display: block; text-decoration: none !important; color: inherit; height: 100%; }\n\n/* サムネイル（ホバーで画像が少し拡大するアニメーション） */\n.post-list-thumb { aspect-ratio: 16/9; overflow: hidden; }\n.post-list-thumb img { \n\twidth: 100%; \n\theight: 100%; \n\tobject-fit: cover; \n\tdisplay: block; \n\ttransition: transform 0.3s ease;\n}\n.post-list-item:hover .post-list-thumb img {\n\ttransform: scale(1.05);\n}\n\n.post-list-body { padding: 14px; }\n.post-list-title { color: #fff; font-weight: 700; font-size: 14px; margin: 0 0 6px !important; }\n.post-list-excerpt { color: #a8a8c0; font-size: 12px; line-height: 1.6; margin: 0 0 8px !important; }\n.post-list-more { color: #00d2d3; font-size: 12px; font-weight: 700; }\n.post-list-archive-link { text-align: center; margin-top: 16px; }\n.post-list-archive-link a { color: #111622; font-weight: 700; text-decoration: none !important; border-bottom: 2px solid #FAC775; padding-bottom: 2px; }\n\n@media (max-width: 680px) {\n\t.post-list-cols-3, .post-list-cols-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }\n}\n@media (max-width: 480px) {\n\t.post-list-cols-2, .post-list-cols-3, .post-list-cols-4 { grid-template-columns: minmax(0, 1fr); }\n}\n</style><script>\ndocument.querySelectorAll('.post-list-wrapper').forEach(function (block) {\n\tif (block.dataset.bound) return;\n\tblock.dataset.bound = 'true';\n\n\tvar inEditor = document.body.classList.contains('block-editor-iframe__body') ||\n\t\tdocument.body.classList.contains('editor-styles-wrapper') ||\n\t\tdocument.body.classList.contains('wp-admin');\n\tif (inEditor) {\n\t\tblock.querySelectorAll('a[href]').forEach(function (a) {\n\t\t\ta.addEventListener('click', function (e) { e.preventDefault(); });\n\t\t});\n\t}\n});\n</script>\n<?php endif; ?>",
      "frontend_callback": "",
      "show_preview": "always",
      "single_output": true
    },
    "style": {
      "block": "",
      "editor": ""
    },
    "script": {
      "view": ""
    },
    "styles": [],
    "condition": [],
    "edit_url": null,
    "provide_context_to_blocks": "",
    "custom_context_slug": "",
    "allowed_blocks": "",
    "ancestor": ""
  }
]