Skip to main content
Code Tutorial

Why use TypeRocket for WordPress?

Contents

TypeRocket makes coding beautiful themes simple and fast by removing the need for most plugins and putting the tools you need in one place.

Case Study

Great news! A bookstore down the street needs a website to feature their top selling titles. They have a $5000 budget and contacted you about the job.

The scope of work is spelled out and the client is excited.

You're going to give them the ability to add and edit books. The books will have fields for the book title, description, author, publisher, ISBN and cover photo.

WordPress API

WordPress makes adding the books feature really easy. All you need to do is create a post type for the books.

Lets, take a look at how to register a basic post type using the WordPress API.

<?php // functions.php
add_action( 'init', function() {
    $args = [
      'public' => true,
      'label'  => 'Books'
    ];
    register_post_type( 'book', $args );
});

Not too hard, even though you needed to use a WordPress hook. However, 3 issues pop up once you take a closer look.

  1. You have a "Pin" icon in the menu bar. This doesn't feel professional. It would be nice to have an icon of a "Book".
  2. Also, some of the labels say "Post". You need them to say "Book".
  3. What about the fields?

You could take the time to write more code, we have the ultimate tutorial for post types too, but that will reduce your net profit. Using the core WordPress API is going to take too much time.

Plugins

You might be thinking, "I can use plugins to add custom fields and post types!" And you're right. Plugins are an excellent choice. Advance Custom Fields is really powerful and you don't have to write much code at all. Plus, Custom Post Type UI lets you add the "Book" post type without a hitch.

However, you've built a few WordPress sites and know when the client logs in those plugins might confuse them. Plus, they could potentially update a plugin and break the design down the road.

You want this project the look great without compromising the client's experience.

TypeRocket

This is where TypeRocket comes in handy. With 15 lines of code, you complete the scope of work. Easier than plugins.

<?php // functions.php

$book = tr_post_type('Book')->setIcon('Book');
$bookDetails = tr_meta_box('Book Details');
$book->apply($bookDetails);

function add_meta_content_book_details()
{
  $form = tr_form();
  echo $form->text('Author');
  echo $form->text('Publisher');
  echo $form->text('ISBN');
  echo $form->image('Book Cover');
}

Because you are using TypeRocket the bookstore is a breeze to setup and you accomplish all of your goals.

  1. A beautiful simple content management experience.
  2. A happy confident client.
  3. A quick turn around with high profits.

Access More TypeRocket

Join our community mailing list and get notified before anyone else. Get videos and more.

By using our website you agree to our Cookie policy.