ralfhortt/wp-content-width

在单个位置设置全局 WordPress 变量 `$content_width` 用于 php 和 css

1.4 2020-01-16 13:36 UTC

This package is auto-updated.

Last update: 2024-09-16 23:44:50 UTC


README

在单个位置设置全局 WordPress 变量 $content_width 用于 php 和 css

安装

$ composer require ralfhortt/wp-content-width

使用

<?php
use RalfHortt\ContentWidth\ContentWidth;

(new ContentWidth(980))->register();
.container {
	margin-left: auto;
	margin-right: auto;
	max-width: var(--content-width);
	width: 100%;
}