Edit Theme Wordpress Agar Support Widgets

August 31, 2008 no comments

Saat kita lagi milih2 ato nyari2 theme wordpress, kita ketemu sebuah theme yg menarik dan kita suka. Lalu kita pasang di blog / website kita. Pas waktu mau edit sidebar widgets nya, ternyata muncul pesan kalau theme tersebut gak support sidebar widgets. Jengkel? Marah? Bingung? Putus asa?

Coba pake cara ini :

  • Backup dulu file theme nya.
  • Buka file functions.php dan pasang script berikut di bagian atas halaman functions.php lalu simpan dan keluar dari functions.php :

    <?php
    if ( function_exists(’register_sidebar’) )
    register_sidebar();
    ?>

  • Sekarang buka file sidebar.php dan tambahkan kode berikut di bawah tag <ul> paling atas dari halaman sidebar.php :

    <?php if ( !function_exists(’dynamic_sidebar’)
    || !dynamic_sidebar() ) : ?>

  • Masih di sidebar.php, sekarang scroll ke bawah dan pasangkan kode berikut tepat di atas tag </ul> paling bawah lalu save dan keluar dari file sidebar.php :

    <?php endif; ?>

Silahkan dicoba untuk edit sidebar widgets nya, seharusnya udah bisa. Kalo ada apa2 silahkan reply di comment aja.


Install Wordpress

May 16, 2008 no comments

Sebenernya tutorial ini udah ada di websitenya wordpress, tapi males buat nyari2 lagi, mending nulis lagi ndiri.

  1. Download wordpress di sini.
  2. Extract file .zip nya.
    Di windows bisa pake winzip ato yg lainnya.
    Di *nix bisa pake command di bawah ini, wordpress-xx adalah nama file wordpress dengan versinya

    # unzip wordpress-xx.zip

  3. Login ke mysql

    # mysql -u root -p
    Enter password:
    Welcome to the MySQL monitor. Commands end with ; or \g.
    Your MySQL connection id is 5340 to server version: 3.23.54
    Type ‘help;’ or ‘\h’ for help. Type ‘\c’ to clear the buffer.

    mysql>

  4. Buat database, misal nama databasenya wp_db

    mysql> CREATE DATABASE wp_db;
    Query OK, 1 row affected (0.00 sec)

  5. Kasih privileges ke root (wordpress username) di localhost (hostname) buat akses semua database wp_db dengan password root = ngawurpoll

    mysql> GRANT ALL PRIVILEGES ON wp_db.* TO root@localhost IDENTIFIED BY ‘ngawurpoll’;
    Query OK, 0 rows affected (0.00 sec)
    mysql> FLUSH PRIVILEGES;
    Query OK, 0 rows affected (0.01 sec)

  6. Keluar dari mysql

    mysql> EXIT
    Bye
    #

  7. Rename file wp-config-sample.php jadi wp-config.php
    Di *nix pake command ini

    # mv wp-config-sample.php wp-config.php

  8. Buka file wp-config.php
    Di *nix bisa pake command ini

    # vi wp-config.php

  9. Tekan tombol “i” di keyboard untuk mulai mengedit file
    Edit seperti di bawah ini

    // ** MySQL settings ** //
    define(’DB_NAME’, ‘wp_db‘); // The name of the database
    define(’DB_USER’, ‘
    root‘); // Your MySQL username
    define(’DB_PASSWORD’, ‘
    ngawurpoll‘); // …and password
    define(’DB_HOST’, ‘localhost’); // 99% chance you won’t need to change this value
    define(’DB_CHARSET’, ‘utf8′);
    define(’DB_COLLATE’, ”);
    // Change SECRET_KEY to a unique phrase. You won’t have to remember it later,
    // so make it long and complicated. You can visit https://www.grc.com/passwords.htm
    // to get a phrase generated for you, or just make something up.
    define(’SECRET_KEY’, ‘put your unique phrase here’); // Change this to a unique phrase.

  10. Kalo udah selesai edit, tekan tombol escape (Esc), lalu ketik seperti di bawah ini (yg pake *nix) :wq!

    ini maksudnya titik dua (:) untuk mulai menulis perintah di vi, w itu untuk write, q untuk quit, tanda seru (!) ini cuma optional aja. Jadi maksudny adalah save and exit.

  11. Sekarang coba buka alamat website anda yg sedang diinstall wordpress ini. Lalu ikuti langkah2 selanjutnya.