我们做产品详情页的时候,为了提高产品的转化率,就是喜欢在产品页面插入很多的图片。我们几乎每次都要设置图片的尺寸、对齐方式和链接方式,是比较耗时费力的。其实我们可以给这几个选项设置默认参数,省去我们每次设置的麻烦。
其实很simple.把如下代码插好入主题的 functions.php 文件即可:
/** * WordPress 设置图片的默认显示方式(尺寸/对齐方式/链接到) * https://www.wpdaxue.com/image-default-size-align-link-type.html */ add_action( 'after_setup_theme', 'default_attachment_display_settings' ); function default_attachment_display_settings() { update_option( 'image_default_align', 'left' ); update_option( 'image_default_link_type', 'none' ); update_option( 'image_default_size', 'full' );
代码中有三个选项,它们各自的参数如下,你可以根据自己的需要进行设置:
image_default_align
- left
- right
- center
- none
image_default_link_type
- file
- post
- custom
- none
image_default_size
- thumbnail
- medium
- large
- full
其实,WooCommerce做商城真的是全世界上最好的程序了。因为wordpress可以给你的网站在google上很好的排名,同时,博客类的网站猎取流量的难度比单独的电子商要容易很多。所以,一般喜欢SEO与google系流量的独立站卖,最好是从WooCommerce入手。
找好一个NICH,不断输出内容,1-3个月左右,基本上每天IP流量就能达到100左右,月IP到3000左右,Session在1W-1.5W左右(看你的内容与站内SEO来定)。而且这个SEO流量很转化率很高,所以在众多平台中,想要做长期稳定独立站的就选WooCommerce吧。