وردپرس

Cannot build my first block


Hi all,

I’m trying to build my first block with this tutorial, and installed wp-env and @wordpress/scripts etc. based on previous introduction. However, the first block “copyright-date-block” cannot be shown in my new post/page and I cannot find any introduction about this problem.

My steps are:

  1. Create a block plugin by command:

npx @wordpress/create-block@latest copyright-date-block –variant=dynamic

  1. Enter copyright-date-block and start wp-env:

wp-env start

  1. Visit http://localhost:8888, login, and make sure the copyright date block plugin is activated.
  2. Click “New” to the page for creating a new post/page, Click the add icon to open the blocks, search “copy”, it should exist based on the tutorial but it doesn’t.

Other information may help:

  1. In web dev tools, there is only css being loaded. 
  2. block.json and index.js is able to be visited in url. So it is deployed to the server.
  3. Not use wp-env, but copy the build folder and copyright-date-block.php to another wordpress environment, the problem still exists.

Code was uploaded to this github repository.

Thanks for any suggestions.

The page I need help with: [log in to see the link]

این خبر را در ایران وب سازان مرجع وب و فناوری دنبال کنید

مشاهده پاسخ های این مطلب
———————————————
این مطلب از سایت انجمن وردپرس گردآوری شده است و کلیه حقوق مطلق به انجمن وردپرس می باشد در صورت مغایرت و یا بروز مشکل اطلاع دهید تا حذف گردد

منبع: انجمن وردپرس

دکمه بازگشت به بالا