我有个问题。每个页面都有相同的标题图像。我使用以下代码:
<?php
$options = array('id' => 'Image', 'width' => '500', 'class' => 'cssclass(optional)');
echo ipSlot('image', $options);
?>
我想a![enter image description here][1]
在每个页面上选择随机图像而不使用块。
谢谢!
我有个问题。每个页面都有相同的标题图像。我使用以下代码:
<?php
$options = array('id' => 'Image', 'width' => '500', 'class' => 'cssclass(optional)');
echo ipSlot('image', $options);
?>
我想a![enter image description here][1]
在每个页面上选择随机图像而不使用块。
谢谢!
将当前页面 ID 添加为图像 ID,您将拥有每个页面的单独图像。例如。:
$options = array('id' => 'Image' . ipContent()->getCurrentPage()->getId(), 'width' => '500', 'class' => 'cssclass(optional)');
echo ipSlot('image', $options);
当您选择图像时,其下方有“应用到”过滤器。选择“当前页面和所有子页面”,你会得到你想要的。无需破解页面 ID。除非你想要那样。