It works in the preview, but it doesn’t work when I place it on the page

It shows the categories properly in the preview, but the categories disappear when I place them on the fixed page. I also looked at the source code, but it was not output. I need a clue, so please help me. I think my code is bad.

There are three query loop blocks on the page where I placed them. (Deleting them didn’t change anything, but…)

<ul>
  <loop type="post" count="6">
    <li>
      <div>
        <div class="wp-block-post-date typesquare_option">
          <time datetime="{Field publish_date}" class="typesquare_option">
            <a href="{Field url}" class="typesquare_option">
              <Date format="Y.m.d" />
            </a>
          </time>
        </div>
        <Loop taxonomy="category" post="current">
          <div class="taxonomy-category {Field name /}">
            <a href="{Field url}" rel="tag" class="typesquare_option">
              <Term title />
            </a>
          </div>
        </Loop>
        <Loop type="post">
          <a href="{Field url}" target="_self" class="typesquare_option" rel="noopener">
            <Field name="title" />
          </a>
        </Loop>
      </div>
    </li>
  </loop>
</ul>


スクリーンショット 2024-01-13 0.10.16

Is this perhaps just a capitalization issue? I noticed that the L in Loop isn’t capitalized here:

<loop type="post" count="6">
1 Like

What the hell! That was exactly the problem! I missed it. Thank you for helping me♥

Thanks to you, it worked. I was able to color-code the categories in the new arrivals list. It was difficult with query loop blocks. I’ll leave you a source that worked well for your reference. Loops & Logic is a great plugin :heart:

<div class="wp-block-query news is-layout-flow wp-block-query-is-layout-flow">
  <ul class="wp-block-post-template is-layout-flow wp-block-post-template-is-layout-flow">
    <Loop type="post" count="6">
      <li class="wp-block-post post-1 post type-post status-publish format-standard hentry category-uncategorized typesquare_option">
        <div class="wp-block-group is-nowrap is-layout-flex wp-container-core-group-layout-1 wp-block-group-is-layout-flex typesquare_option">
          <div class="wp-block-group is-nowrap is-layout-flex wp-container-core-group-layout-1 wp-block-group-is-layout-flex typesquare_option">
            <div class="wp-block-post-date typesquare_option">
              <time datetime="{Field publish_date}" class="typesquare_option">
                <a href="{Field url}" class="typesquare_option">
                  <Date format="Y.m.d" />
                </a>
              </time>
            </div>
            <Loop taxonomy="category" post="current">
              <div class="taxonomy-category {Field name /}">
                <a href="{Field url}" rel="tag" class="typesquare_option">
                  <Term title />
                </a>
              </div>
            </Loop>
            <h3>
              <a href="{Field url}" target="_self" class="typesquare_option" rel="noopener">
                <Field name="title" />
              </a>
            </h3>
          </div>
        </div>
      </li>
    </Loop>
  </ul>
</div>

3 Likes

I’m glad this worked for you! I like your design too, nicely colorful and clean.

Thanks for the kind words! If ever you feel like supporting the development of this free plugin with a positive review on the WordPress plugin repo, it’d be much appreciated :slight_smile:

1 Like