<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>Forem: Almaz Bisenbaev</title>
    <description>The latest articles on Forem by Almaz Bisenbaev (@almazbisenbaev).</description>
    <link>https://forem.com/almazbisenbaev</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F639289%2F4079e874-707e-4abb-a60e-e8447baa2812.jpg</url>
      <title>Forem: Almaz Bisenbaev</title>
      <link>https://forem.com/almazbisenbaev</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.com/feed/almazbisenbaev"/>
    <language>en</language>
    <item>
      <title>Let’s Explore the New CSS “@function” Rule</title>
      <dc:creator>Almaz Bisenbaev</dc:creator>
      <pubDate>Fri, 19 Sep 2025 22:17:17 +0000</pubDate>
      <link>https://forem.com/almazbisenbaev/lets-explore-the-new-css-function-rule-3dnd</link>
      <guid>https://forem.com/almazbisenbaev/lets-explore-the-new-css-function-rule-3dnd</guid>
      <description>&lt;p&gt;If you've been keeping an eye on the evolution of CSS, you might have heard about this new feature that kinda turns CSS into a programming language (I’m exaggerating, but still). &lt;/p&gt;

&lt;p&gt;The &lt;code&gt;@function&lt;/code&gt; rule is a proposed addition to CSS that lets us define custom functions. It’s kinda similar what we call Mixins in Sass.&lt;/p&gt;

&lt;p&gt;In this post I’ll try to show you how it works and what we can do with it. I’ll show you a few practical examples and use cases that highlight its potential to streamline your workflow and create more maintainable designs.&lt;/p&gt;

&lt;h2&gt;
  
  
  What is @function?
&lt;/h2&gt;

&lt;p&gt;At its core, the &lt;code&gt;@function&lt;/code&gt; rule is part of the CSS Functions and Mixins Module Level 1, a working draft from the W3C that introduces logic into CSS. Think of it as creating your own mini-functions that can accept arguments, perform computations, and return values. These functions are invoked similarly to custom properties (using a dashed name like &lt;code&gt;--example-function()&lt;/code&gt;), but they go beyond simple variable substitution by supporting parameters, defaults and even conditional rules like &lt;code&gt;@media&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;Unlike built-in CSS functions such as &lt;code&gt;calc()&lt;/code&gt; or &lt;code&gt;clamp()&lt;/code&gt;, which are predefined, &lt;code&gt;@function&lt;/code&gt; lets you define custom ones. This means you can encapsulate complex calculations or styles that would otherwise clutter your code or require external tools. It's especially useful for design systems where consistency and scalability are the key.&lt;/p&gt;

&lt;p&gt;The rule is still emerging, but as of the end of 2025, it's starting to land in Chromium-based browsers. Firefox and Safari support is pending, so for now, it should be used with &lt;code&gt;@supports&lt;/code&gt; or as a progressive enhancement.&lt;/p&gt;

&lt;h2&gt;
  
  
  How Does @function Work? A Quick Syntax Overview
&lt;/h2&gt;

&lt;p&gt;Creating a function is simple and straightforward. You use the &lt;code&gt;@function&lt;/code&gt; at-rule followed by a dashed name, optional parameters with types and defaults and a body that ends with a &lt;code&gt;result&lt;/code&gt; descriptor specifying the output.&lt;/p&gt;

&lt;p&gt;Here's the basic syntax:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;@function --set-font-size(--size-small type(length), --size-large type(length)) {

  /* Let's say this is our condition */
  @media (width &amp;gt; 640px) {
    result: var(--size-small); /* We will return the first parameter for small screens */
  }

  result: var(--size-large); /* ... and the second one the above condition is not met */
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;To use the function:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight css"&gt;&lt;code&gt;&lt;span class="nc"&gt;.heading&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nl"&gt;width&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;--set-font-size&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="m"&gt;24px&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="m"&gt;36px&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="nc"&gt;.quote&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nl"&gt;width&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;--set-font-size&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="m"&gt;16px&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="m"&gt;18px&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This example may not look practical, but the point is that you can reuse the same function in different places many times.&lt;/p&gt;

&lt;p&gt;Parameters can be of different types (e.g. &lt;code&gt;length&lt;/code&gt;, &lt;code&gt;color&lt;/code&gt; or more complex syntax via &lt;code&gt;type()&lt;/code&gt;) and the function evaluates at computed-value time, inheriting context from where it's called. If arguments don't match, it falls back gracefully to an invalid value.&lt;/p&gt;

&lt;h2&gt;
  
  
  What We Can Do With @function
&lt;/h2&gt;

&lt;p&gt;The real magic of &lt;code&gt;@function&lt;/code&gt; lies in what it enables. Let’s see some examples.&lt;/p&gt;

&lt;h3&gt;
  
  
  1. Unit Conversions (e.g. pixels to rems)
&lt;/h3&gt;

&lt;p&gt;Tired of manually converting units? Create a function to handle it automatically. This is great for accessibility-focused designs where rem units ensure better scaling.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight css"&gt;&lt;code&gt;&lt;span class="k"&gt;@function&lt;/span&gt; &lt;span class="n"&gt;--px-to-rem&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;--px&lt;/span&gt; &lt;span class="n"&gt;type&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;length&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="py"&gt;result&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;calc&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;var&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;--px&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;/&lt;/span&gt; &lt;span class="m"&gt;16&lt;/span&gt; &lt;span class="err"&gt;*&lt;/span&gt; &lt;span class="m"&gt;1rem&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt; &lt;span class="c"&gt;/* Assuming 16px root font size */&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="nt"&gt;h1&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nl"&gt;font-size&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;--px-to-rem&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="m"&gt;32px&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  2. Color Manipulations (e.g. opacity or tints)
&lt;/h3&gt;

&lt;p&gt;Functions shine in color processing. Need a semi-transparent version of a base color? Define an opacity helper:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight css"&gt;&lt;code&gt;&lt;span class="k"&gt;@function&lt;/span&gt; &lt;span class="n"&gt;--opacity&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;--color&lt;/span&gt; &lt;span class="n"&gt;type&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;color&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt; &lt;span class="n"&gt;--level&lt;/span&gt; &lt;span class="n"&gt;type&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;number&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt; &lt;span class="m"&gt;0.5&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="py"&gt;result&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;rgb&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;from&lt;/span&gt; &lt;span class="n"&gt;var&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;--color&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="n"&gt;r&lt;/span&gt; &lt;span class="n"&gt;g&lt;/span&gt; &lt;span class="n"&gt;b&lt;/span&gt; &lt;span class="p"&gt;/&lt;/span&gt; &lt;span class="n"&gt;var&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;--level&lt;/span&gt;&lt;span class="p"&gt;));&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="nc"&gt;.button&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nl"&gt;background-color&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;--opacity&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="m"&gt;#F00&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="m"&gt;0.8&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This can extend to tinting, shading, or even contrast checks for better accessibility.&lt;/p&gt;

&lt;h3&gt;
  
  
  3. Fluid Typography and Scaling
&lt;/h3&gt;

&lt;p&gt;One of the most popular use cases is fluid typography that scales smoothly with viewport size, clamped between min and max values.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight css"&gt;&lt;code&gt;&lt;span class="k"&gt;@function&lt;/span&gt; &lt;span class="n"&gt;--fluid-type&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;--min&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;--max&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;--scale&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="py"&gt;result&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;clamp&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
    &lt;span class="n"&gt;var&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;--min&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt;
    &lt;span class="n"&gt;calc&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;var&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;--min&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="err"&gt;+&lt;/span&gt; &lt;span class="n"&gt;var&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;--scale&lt;/span&gt;&lt;span class="p"&gt;)),&lt;/span&gt;
    &lt;span class="n"&gt;var&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;--max&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
  &lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="nt"&gt;h1&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nl"&gt;font-size&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;--fluid-type&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="m"&gt;20px&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="m"&gt;40px&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="m"&gt;5vw&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="nt"&gt;p&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nl"&gt;font-size&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;--fluid-type&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="m"&gt;14px&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="m"&gt;18px&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="m"&gt;2vw&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This makes responsive text effortless, adapting to different screen sizes without media queries everywhere.&lt;/p&gt;

&lt;p&gt;These examples barely scratch the surface. Imagine functions for random values, advanced math, or even integrating with custom properties for theme switching. The key benefit? Reduced repetition, easier maintenance, and more expressive CSS.&lt;/p&gt;

&lt;h2&gt;
  
  
  Browser Support and Considerations
&lt;/h2&gt;

&lt;p&gt;As mentioned, support is limited but growing. It's available in Chrome 139+ and Edge 139+, with Android variants following suit. For broader compatibility, wrap usages in &lt;code&gt;@supports selector(--my-function()) { ... }&lt;/code&gt; to provide fallbacks. Keep an eye on updates, this could become a staple in CSS soon.&lt;/p&gt;

&lt;p&gt;The &lt;code&gt;@function&lt;/code&gt; rule is poised to transform how we write CSS, bridging the gap between static styles and dynamic logic. By enabling custom computations and conditionals, it empowers developers to build more robust, scalable designs without external dependencies. Whether you're tweaking colors, scaling elements or handling responsiveness, it's a tool that encourages creativity and efficiency.&lt;/p&gt;

</description>
      <category>css</category>
      <category>frontend</category>
      <category>webdev</category>
      <category>website</category>
    </item>
    <item>
      <title>How to Write CSS in 2025 – Modern Features You Should Be Using (with examples)</title>
      <dc:creator>Almaz Bisenbaev</dc:creator>
      <pubDate>Thu, 05 Jun 2025 07:03:47 +0000</pubDate>
      <link>https://forem.com/almazbisenbaev/how-to-write-css-in-2025-modern-features-you-should-be-using-with-examples-3g47</link>
      <guid>https://forem.com/almazbisenbaev/how-to-write-css-in-2025-modern-features-you-should-be-using-with-examples-3g47</guid>
      <description>&lt;p&gt;CSS has come a long way. If you're still relying only on floats and basic media queries, you're missing out. Let's explore how to write much better, more powerful CSS today using features that are now widely available.&lt;/p&gt;

&lt;h2&gt;
  
  
  1. Subgrid (90% support)
&lt;/h2&gt;

&lt;p&gt;Perfect for nested layouts where child elements need to align with the parent grid (card layouts, nested forms, or dashboards where alignment matters).&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;.parent {
  display: grid;
  grid-template-columns: 1fr 2fr;
}

.child {
  display: subgrid;
  grid-column: span 2;
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  2. Nesting (90% suport)
&lt;/h2&gt;

&lt;p&gt;Yep, no more Sass for basic nesting. Native CSS nesting lets you group related styles, reduce repetition, and improve readability, without preprocessors.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;.card {
  padding: 1rem;

  &amp;amp;:hover {
    background: #f0f0f0;
  }

  .title {
    font-weight: bold;
  }
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  3. Container Queries (86% support)
&lt;/h2&gt;

&lt;p&gt;Style components based on their container’s size, not the viewport. This makes your components truly responsive and reusable.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;.card {
  container-type: inline-size;
}

@container (min-width: 600px) {
  .card-content {
    display: flex;
  }
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  4. :has() (92% support)
&lt;/h2&gt;

&lt;p&gt;This is the holy grail of CSS - a parent selector. It enables conditional styling based on child elements, something that was impossible until now.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;.card:has(img) {
  border: 1px solid purple;
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  5. :focus-within (95% support)
&lt;/h2&gt;

&lt;p&gt;Highlight form groups when any child is focused.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;.form-group:focus-within {
  outline: 2px solid #7f5af0;
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  6. @layer (94% support)
&lt;/h2&gt;

&lt;p&gt;Tired of specificity wars? CSS layers (@layer) give you explicit control over which styles override others. Ideal for large codebases, design systems, or when using multiple CSS sources.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;@layer base, components, utilities;

@layer base {
  body {
    margin: 0;
  }
}

@layer components {
  .btn {
    padding: 0.5rem 1rem;
  }
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Sooo...
&lt;/h2&gt;

&lt;p&gt;Modern CSS is modular, scalable and intelligent. You can build responsive components without JavaScript, write cleaner code without preprocessors and manage specificity with precision.&lt;/p&gt;

</description>
      <category>css</category>
      <category>frontend</category>
      <category>webdev</category>
    </item>
    <item>
      <title>The easiest and fastest way to create a Custom Post Type in WordPress</title>
      <dc:creator>Almaz Bisenbaev</dc:creator>
      <pubDate>Wed, 21 Aug 2024 23:27:11 +0000</pubDate>
      <link>https://forem.com/almazbisenbaev/the-easiest-and-fastest-way-to-create-a-custom-post-type-in-wordpress-4pgh</link>
      <guid>https://forem.com/almazbisenbaev/the-easiest-and-fastest-way-to-create-a-custom-post-type-in-wordpress-4pgh</guid>
      <description>&lt;p&gt;There are two ways to create a &lt;strong&gt;Custom Post Type in WordPress&lt;/strong&gt; (that I know of). The first one involves copy&amp;amp;pasting a little snippet of PHP code into your &lt;strong&gt;functions.php&lt;/strong&gt;, and the second one allows you to do achieve the same with a few mouse clicks.&lt;/p&gt;

&lt;p&gt;Let’s start from the first one.&lt;/p&gt;

&lt;h2&gt;
  
  
  Method 1: Creating a Custom Post Type Through functions.php
&lt;/h2&gt;

&lt;p&gt;For developers who prefer a hands-on approach, adding custom post types through code is a powerful method. You can define custom post types by adding code to your theme’s &lt;code&gt;functions.php&lt;/code&gt; file. Here’s a simple example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;function create_custom_post_type() {

    $labels = array(
        'name'               =&amp;gt; __('Books'),
        'singular_name'      =&amp;gt; __('Book'),
        'menu_name'          =&amp;gt; __('Books'),
        'name_admin_bar'     =&amp;gt; __('Book'),
        'add_new'            =&amp;gt; __('Add New', 'book'),
        'add_new_item'       =&amp;gt; __('Add New Book'),
        'new_item'           =&amp;gt; __('New Book'),
        'edit_item'          =&amp;gt; __('Edit Book'),
        'view_item'          =&amp;gt; __('View Book'),
        'all_items'          =&amp;gt; __('All Books')
    );

    $args = array(
        'labels'             =&amp;gt; $labels,
        'public'             =&amp;gt; true,
        'capability_type'    =&amp;gt; 'post',
        'has_archive'        =&amp;gt; true,
        'hierarchical'       =&amp;gt; false,
        'supports'           =&amp;gt; array('title', 'editor', 'thumbnail')
    );

    register_post_type('book', $args);
}

add_action('init', 'create_custom_post_type');
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Throw this piece of code into your functions.php and your custom post type called “Books” will show up in the admin menu.&lt;/p&gt;

&lt;p&gt;This method gives you complete control over the post type’s configuration, but it requires familiarity with PHP and WordPress functions.&lt;/p&gt;

&lt;h2&gt;
  
  
  Method 2: Creating a Custom Post Type Using WP Power Tools
&lt;/h2&gt;

&lt;p&gt;In order to avoid copy&amp;amp;pasting the same code through all my clients’ websites, I created this little plugin that allows me to do these repetitive tasks with a mouse mouse clicks, and I published the plugin on Github for everyone to use.&lt;/p&gt;

&lt;p&gt;The source code of the plugin is here: &lt;a href="https://github.com/almazbisenbaev/wp-powertools" rel="noopener noreferrer"&gt;https://github.com/almazbisenbaev/wp-powertools&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;When you install it, among other tools you will find a tool called CPT Manager. The tools does exactly the same as what you could achieve with the code above, just easier and faster.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fcovzptogtzddmy7vv2w9.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fcovzptogtzddmy7vv2w9.png" alt="The screenshot of CPT Manager in  Power Tools" width="800" height="531"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;If you tried out my plugin, don’t forget to give it a star on github, I would really appreciate it.&lt;/p&gt;

</description>
    </item>
    <item>
      <title>2 easy ways disable Gutenberg editor in WordPress</title>
      <dc:creator>Almaz Bisenbaev</dc:creator>
      <pubDate>Sun, 12 May 2024 15:23:29 +0000</pubDate>
      <link>https://forem.com/almazbisenbaev/2-easy-ways-disable-gutenberg-editor-in-wordpress-3okf</link>
      <guid>https://forem.com/almazbisenbaev/2-easy-ways-disable-gutenberg-editor-in-wordpress-3okf</guid>
      <description>&lt;p&gt;Gutenberg, the new editor that was introduced into WordPress since version 5.0 has a lot of cool features. But it in some cases, when you don’t actually need it, it still bloats your website with unused CSS and JS.&lt;/p&gt;

&lt;p&gt;Here are the two easy ways to disable Gutenberg:&lt;/p&gt;

&lt;h2&gt;
  
  
  By pasting this PHP code into your functions.php:
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;// Disable Gutenberg on the back end
add_filter( 'use_block_editor_for_post', '__return_false' );

// Disable Gutenberg for widgets
add_filter( 'use_widgets_block_editor', '__return_false' );

add_action( 'wp_enqueue_scripts', function() {

    // Remove CSS on the front end
    wp_dequeue_style( 'wp-block-library' );

    // Remove Gutenberg theme
    wp_dequeue_style( 'wp-block-library-theme' );

    // Remove inline global CSS on the front end
    wp_dequeue_style( 'global-styles' );

    // Remove classic-themes CSS for backwards compatibility for button blocks
    wp_dequeue_style( 'classic-theme-styles' );

}, 20 );
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Using PowerTools
&lt;/h2&gt;

&lt;p&gt;PowerTools is a free WordPress plugin that is aimed to improve your productivity by solving some of the tasks that you encounter when building a website. I created it for myself and published the souce code on GitHub.&lt;/p&gt;

&lt;p&gt;It allows you to disable Gutenberg just by ticking one checkbox:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fahug7m6sm1y77dcasl39.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fahug7m6sm1y77dcasl39.png" alt="Gutenberg Disabler tool in PowerTools" width="800" height="381"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;All you need to do is download the plugin from GitHub, install it and find Gutenberg Disabler in the list of the tools that the plugin features.&lt;/p&gt;

&lt;p&gt;It’s that easy!&lt;/p&gt;

</description>
      <category>wordpress</category>
      <category>gutenberg</category>
      <category>plugins</category>
      <category>webdev</category>
    </item>
  </channel>
</rss>
