Select Page
Woocommerce Divi Shop的手機版本頁面,要改成兩欄顯示

Woocommerce Divi Shop的手機版本頁面,要改成兩欄顯示

如果你有需要想要讓 WordPress 的 Woocommerce 在手機版本的商店頁面中顯示兩欄的商品,那最好的方法要自訂 CSS ,我在這邊展示的是用 DIVI 佈景主題來做自訂CSS,如果你是別家的也是都一樣的方法。

只要把下面的CSS複製起來

@media only screen and (max-width:768px) {
    .woocommerce-page ul.products{
        display: flex;
        -webkit-box-orient: horizontal;
        -webkit-box-direction: normal;
         flex-flow: row wrap;
    }
    .woocommerce-page ul.products li.product{
         flex: 0 0 50%;
         -webkit-box-flex: 0;
         padding: 10px;
    }
}

貼到你的佈景主題中的自訂CSS的位置上就可以了

WordPress 關閉自動更新的方法

WordPress 關閉自動更新的方法

自動更新是個好功能,但因為 WordPress 本身的特性,外掛幾乎都是第三方寫的,總是難免會有很多的衝突,要求一個穩定的系統,只能把自動更新關閉,之後手動更新,確認沒有衝突後再讓他全站更新出去,才能確保穩定性,以下介紹幾種關閉自動更新的方法。

1.使用佈景主題內的 functions.php 寫入關閉自動更新的程式碼

將以下的程式碼放到佈景主題下的functions.php中即可

// 關閉自動更新以及通知
function remove_core_updates(){
global $wp_version;return(object) array('last_checked'=> time(),'version_checked'=> $wp_version,);
}
add_filter('pre_site_transient_update_core','remove_core_updates'); //hide updates for WordPress itself
add_filter('pre_site_transient_update_plugins','remove_core_updates'); //hide updates for all plugins000
add_filter('pre_site_transient_update_themes','remove_core_updates'); //hide updates for all themes

2.設定 wp-config.php 檔案

在 WP 的根目錄中,修改 wp-config.php ,將下面這一行加入即可

define( 'WP_AUTO_UPDATE_CORE', false );

3.利用外掛來關閉自動更新

3.1 disable-admin-notices

https://clearfy.pro/disable-admin-notices/