How to add eShop in custom post type in WordPress 3
By default, eShop shopping cart plugin will use standard post to display it’s product options. But it would be better if we can use custom post type which is available in wordpress 3 to have separate post type for our product. First we need to install eShop and Custom Post Type UI then use Custom Post Type UI to create custom post type easily instead of messing around with functions.php.
Next is look for editing eshop-product-entry.php file inside eshop plugin folder. Search for this code approx on line 13
add_meta_box( 'epagepostcustom', __( 'Product Entry', 'eshop' ), 'eshop_inner_custom_box', 'post', 'normal','high' );
Now replace ‘post’ with your newly created post type, i.e: product.
add_meta_box( 'epagepostcustom', __( 'Product Entry', 'eshop' ), 'eshop_inner_custom_box', 'product', 'normal','high' );
That’s all, when you add new product, there’s eShop options available for that custom post type.
How to display future post in WordPress
This is small snippet to display all future posts starting today. Add this before doing the loop
<?php
function filter_where($where = '') {
//posts in the last 30 days
$where .= " AND post_date >= '". date('Y-m-d', strtotime('now')) . "'";
return $where;
}
add_filter('posts_where', 'filter_where');
query_posts($query_string . "post_status=future,publish&orderby=date&order=ASC");
?>
You can limit the result or change order. See Codex for details of using query_posts
Pindah server & Update WP
Akhirnya berhasil juga mindahin hosting web ini ke server baru sekalian update WP ke 2.3.1. Sekarang udah make VPS yg saya sewa sendiri dengan harga yg cukup murah, itung-itung sambil belajar manage VPS berbasis lxAdmin sebagai control panel, web server-nya make lighttpd plus php fast-cgi. Biarpun VPS yg saya pake cuman make memory 160MB, berdasarkan pengalaman, load-nya masih cukup normal. Oya, Buat yg mo pasang wordpress ato drupal di lighttpd, contoh mod_rewrite-nya bisa diliat disini.
Rencana kedepan mo nambahin beberapa account di server ini, utk mengetahui sejauh mana beban yg bisa ditanggung VPS dengan memory 160MB. Tunggu berita selanjutnya
update: di lxadmin ternyata udah ada setup permalink utk drupal & wordpress
WordPress 2.3
Upgrade kali ini lumayan ribet dan bermasalah. WordPress versi 2.3 menghilangkan beberapa table sehingga banyak plugin & theme yg gak kompatibel, termasuk theme yg saya pake masih ada bug. Udah nyoba pake yg versi k2 nightly build tapi tetep aja ada error di backend-nya
. Beberapa plugin juga mengalami masalah yg umumnya merefer ke table yg udah gak ada.
Kelemahan wordpress emang terlalu sering-nya mereka me-rilis versi baru sehingga user harus selalu repot-repot mengupgrade blog-nya, belum lagi masalah kompatibilitas dengan plugin dan themes. Sempet kepikiran mau ganti ke drupal tapi mikirin juga proses migrasi yg bakal gak mulus.
Upgrade wp ke 2.2
As judul, hari ini walopun banyak kerjaan tapi nyempetin juga utk upgrade wordpress ke 2.2 sesuai dengan announcement beberapa hari lalu dari wordpress. Proses upgrade sendiri gak sampe lima menit soalnya langsung wget dan replace dari ssh
Buat yg belum upgrade silahken utk upgrade kalo sempet..