【问题标题】:Wordpress custom headerWordpress 自定义标题
【发布时间】:2015-02-18 12:35:17
【问题描述】:

我目前正在使用带有随机上传图片选项的自定义标题图片。它工作正常。每次我重新加载页面时,它的标题图像都会更改为新的。有没有办法像设置计时器一样手动更改图像。我是wordpress的新手。我现在的代码是这样的

在functions.php中

$args = array(
'width'         => 1856,
'height'        => 448,
'default-image' => 'http://wordpress/wp-content/uploads/2015/02/mbuntu-11.jpg',
'uploads'       => true,);

add_theme_support( 'custom-header', $args );

在 header.php 中

<header class="intro-header" style="background-image: url('<?php header_image(); ?>')">

【问题讨论】:

    标签: php wordpress wordpress-theming


    【解决方案1】:

    在自定义主题页面上添加多个图像。 转到 -> 主题自定义 -> 标题图像 -> 添加图像并保存。 现在检查您的页面,它的工作方式类似于滑块。

    【讨论】:

    • 但它不能用作滑块。仅在页面刷新时更改图像。
    • 如果你想要滑块,那么你可以使用 wordpress.org 中的可用插件。
    • 是的。现在我正在使用插件。我仍然很想知道是否有任何方法可以遍历所有自定义标题图像。
    猜你喜欢
    • 2015-05-07
    • 1970-01-01
    • 2021-09-30
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2016-04-02
    • 1970-01-01
    相关资源
    最近更新 更多