小编use*_*274的帖子

PHP 简单“如果页面 id 是 xyz,则显示此 <div>”

我不熟悉 PHP,但我想在 Wordpress 中创建类似的内容:

if page id="123"
show this -> <div class"option one">my content</div>

if page id="124"
show this -> <div class"option two">my other content</div>

if page id="125"
show this -> <div class"option three">my other content 2</div>
Run Code Online (Sandbox Code Playgroud)

代码将放置在我的page.php中

那么具体的php代码是什么呢?

php wordpress if-statement

-3
推荐指数
1
解决办法
3万
查看次数

标签 统计

if-statement ×1

php ×1

wordpress ×1