Categories
Trik WordPress

Menambah Search Form di Menu Bar

Ada pertanyaan bagus yang disampaikan oleh Sdr. Andi. yaitu bagaimana memasang form pencarian di menu bar. Sebenarnya ada pertanyaan kedua yaitu bagaimana mengubah tampilan tombolnya.

Tapi di artikel ini saya bahas dulu pertanyaan pertamanya aja dulu ya biar penasaran untuk mengubah tombolnya hehehe.. Dan mas Andi biar sering2 kesini juga 😀

Oke, langsung aja ada 2 file yang kita edit yaitu index.php dan style.css. index.php kita gunakan untuk menentukan letak form-nya dan style.css untuk mengubah style-nya.

Pertama, di file index.php anda cari dulu kode untuk menampilkan menu bar-nya yaitu ini:


Di bawah wp_nav_menu kita masukkan deh kode form-nya sehingga hasilnya seperti ini:


Jika anda menjalankan blog sekarang, maka bisa anda lihat kalau form-nya nempel dengan menu-menu yang diatas. Maka kita perlu memisahkannya dan meletakkanya di sebelah kanan. Untuk itu, kita pasang deh style-nya di file style.css dengan kode berikut:

#search {
	float:right;
	}

Sekarang sebuah form sudah hadir di sebelah kanan deretan menu anda 🙂

By Lutvi

Bukan Ustadz, bukan Dai apalagi Kyai. Juga bukan guru. Hanya sekedar santri miskin ilmu yang coba mengamalkan 1 ayat warisan dari para ulama. Saat ini diamanahi menjadi admin web WordPress Indonesia

26 replies on “Menambah Search Form di Menu Bar”

Permisi mas, sejak wp versi 3 fungsi ini bloginfo('url') sudah tidak direkomendasikan lagi, bahkan ketika WP_DEBUG diganti true, fungsi ini menyebabkan error, sebagai gantinya gunakan echo home_url(). Outputnya sama ‘halaman utama’.

wah asyik nih gan maun nanya bagaimana cara membuat footer kayak punya mas lutfi yang empat kolom

oh iya ijin subscribe yah
di sini hampir seluruhnya saya butuhkan
semangat gan!

saya pertama kali pake wordpress sama sekali gak ngerti edit”nya om,,semua serba php… di blog ini ternyata panduannya cukup lengkap,,,jadi bagus bisa membimbing ane yg nubi ini sob..thanks…

I just want to tell you that I’m new to blogs and seriously savored your website. Likely I’m likely to bookmark your blog post . You actually come with terrific stories. Cheers for sharing your webpage.

I just want to tell you that I’m very new to blogging and definitely savored this blog site. Most likely I’m planning to bookmark your website . You certainly come with perfect stories. Thank you for revealing your blog site.

Hiya, I’m really cheerful I have establish this information. Today bloggers distribute only concerning gossips and internet and this is really frustrating. A sunny position with exciting subject matter, this is what I necessary. Thankfulness for keeping this website, I’ll ensue visiting it. Achieve you do newsletters? Can not find it.

Hands down, Apple’s app store wins by a mile. It’s a huge selection of all sorts of apps vs a rather sad selection of a handful for Zune. Microsoft has plans, especially in the realm of games, but I’m not sure I’d want to bet on the future if this aspect is important to you. The iPod is a much better choice in that case.

Simply want to say your article is as astonishing. The clearness in your submit is just nice and i can think you’re an expert on this subject. Fine with your permission let me to grasp your feed to stay updated with imminent post. Thanks 1,000,000 and please continue the gratifying work.

My brother suggested I might like this web site. He was entirely right. This post actually made my day. You can not imagine simply how much time I had spent for this info! Thanks!

Between me and my husband we’ve owned more MP3 players over the years than I can count, including Sansas, iRivers, iPods (classic & touch), the Ibiza Rhapsody, etc. But, the last few years I’ve settled down to one line of players. Why? Because I was happy to discover how well-designed and fun to use the underappreciated (and widely mocked) Zunes are.

Your style is so unique in comparison to other people I have read stuff from. I appreciate you for posting when you’ve got the opportunity, Guess I’ll just bookmark this web site.

Its like you read my mind! You seem to know a lot about this, like you wrote the book in it or something. I think that you can do with some pics to drive the message home a bit, but other than that, this is great blog. An excellent read. I’ll certainly be back.

Comments are closed.