Skip to content

Ikhtisar Chapter 2: First Coding Steps — PHP

Apa yang Dipelajari?

Cara membuat theme WordPress dari nol. Ternyata cuma butuh 1 folder + 2 file.

Poin Utama

Membuat Theme Baru

  1. Buka folder wp-content/themes/
  2. Buat folder baru, misal fictional-university-theme
  3. Buat 2 file di dalamnya:

File 1: index.php — template utama website

php
Ini adalah theme custom kita

File 2: style.css — identitas theme (WAJIB nama ini)

css
/*
  Theme Name: Fictional University
  Author: NamaKamu
  Version: 1.0
*/
  1. Buka WP Admin → Appearance → theme baru muncul → klik Activate

Yang Perlu Diingat

  • File harus bernama style.css dan index.php — WordPress cari nama persis ini
  • style.css bukan cuma untuk CSS, tapi juga kartu identitas theme (nama, author, versi)
  • Tambahkan screenshot.png (1200x900px) ke folder theme supaya ada preview gambar
  • CSS yang ditulis di style.css belum aktif sampai file-nya dimuat via functions.php (dipelajari nanti)

Struktur Folder

fictional-university-theme/
├── index.php        ← halaman utama
├── style.css        ← identitas + styling
└── screenshot.png   ← gambar preview (opsional)

Satu Kalimat

Buat folder di wp-content/themes/, taruh index.php + style.css di dalamnya — selamat, kamu sudah punya theme WordPress sendiri.