wordpress自定义字段插件Advanced Custom Fields PRO 的使用

wodrpress主题开发中,经常会自定义一些幻灯片等等很具特色的东西,但是这些东西需要后台图片,文本数据

的支持,才能完成前后端的数据对接。才好更加方便的修改和维护。

 

其字段添加界面:

wordpress自定义字段插件Advanced Custom Fields PRO 的使用_第1张图片

 




//或者 :




    <?php echo $value["filename"] ?>


配置其自定义字段的位置:


wordpress自定义字段插件Advanced Custom Fields PRO 的使用_第2张图片

在该位置设置自定义字段内容:

 

wordpress自定义字段插件Advanced Custom Fields PRO 的使用_第3张图片

 

当前gallery每一项打印出来的的数据

[0] => Array

(

    [ID] => 387

    [id] => 387

    [title] => 20130416160555214

    [filename] => 20130416160555214-2.jpg

    [url] => http://localhost/wordpress/wp-content/uploads/2017/08/20130416160555214-2.jpg

    [alt] =>

    [author] => 1

    [description] =>

    [caption] =>

    [name] => 20130416160555214-3

    [date] => 2017-08-08 03:34:42

    [modified] => 2017-08-10 06:04:07

    [mime_type] => image/jpeg

    [type] => image

    [icon] => http://localhost/wordpress/wp-includes/images/media/default.png

    [width] => 700

    [height] => 220

    [sizes] => Array

        (

            [thumbnail] => http://localhost/wordpress/wp-content/uploads/2017/08/20130416160555214-2-150x150.jpg

            [thumbnail-width] => 150

            [thumbnail-height] => 150

            [medium] => http://localhost/wordpress/wp-content/uploads/2017/08/20130416160555214-2-300x94.jpg

            [medium-width] => 300

            [medium-height] => 94

            [medium_large] => http://localhost/wordpress/wp-content/uploads/2017/08/20130416160555214-2.jpg

            [medium_large-width] => 700

            [medium_large-height] => 220

            [large] => http://localhost/wordpress/wp-content/uploads/2017/08/20130416160555214-2.jpg

            [large-width] => 700

            [large-height] => 220

        )

)


你可能感兴趣的:(wordpress,php)