كيفية استخدام كتلة الكود في ووردبريس في 3 خطوات بسيطة

There’s a code block that comes with the WordPress core and lets you showcase the code snippets on your WordPress website. WordPress has made it easier to create and display content.

From developers to tech enthusiasts, anyone looking for a way to showcase code snippets, the Code Block is a robust and simple tool. Today, we will share the complete guide on how to use the code block in WordPress below. Be sure to follow us through.

What is the Code Block in WordPress?

ال Code Block is a Gutenberg block designed for adding and displaying code snippets within a post or page.

The Code block highlights the syntax as plain text without executing it, making it ideal for showcasing programming examples or scripts.

إنشاء جداول جميلة
مع محرر الكتل


How to Use the Code Block in WordPress

Using the code block is super easy, as you do not need to use any special skills to use the block. All you need to do is follow the tutorial below.

Step 1: Insert the Code Block

To insert the code block, hit the Add Block (“+“) icon (1), type “Code” in the search box (2), and click “Code(3).

Step 2: Insert Your Coding

When the code block is in the editor, insert your code.

How to use the code block in WordPress

The code block does not have any specific options in the editor. It has all the basic options like every other core block in Gutenberg.

الخطوة 3: التخصيص

WordPress offers color, typography, dimensions, and border options for code block customization. To access the Code Block customization, navigate to Settings (1)> Block (2) > Styles (3)

You can change the color, typography, dimensions, and border.

  1. لون: تتيح لك هذه الوظيفة تغيير لون النص والخلفية.
  2. الطباعة: يتيح لك أسلوب الطباعة تحديد الخطوط وحجم الخط والمظهر وارتفاع السطر والتباعد بين الحروف وحالة الحروف وتزيين الحروف.
  3. أبعاد: تسمح لك الأبعاد بضبط الحشو والهامش لكتلة النص الخاصة بك.
  4. حدود: يتيح لك خيار الحدود إضافة حدود ونصف قطر الحدود لكتلة النص الخاصة بك.

So that’s how you use the code block in WordPress.


الأفكار النهائية!

Finally, the code block is essential for anyone who wants to showcase the code snippets on their WordPress website.

It is easy to use, offers useful customization options, and keeps your content secure by preventing code execution.

Start using the Code block today to elevate your content and make your site a go-to resource for technical insights!

Let me hear your shoutouts about the post and the block in the comment section. Also, let your developer friends know about this awesome post through social media.

اقرأ المزيد!



فريق Tableberg