我要投稿 | 网站地图 专注WordPress建站学习
WordPress教程网
热门标签: wordpress教程 wordpress wordpress函数 WordPress建站 wordpress插件

教程

当前位置:首页> 教程

WordPress函数get_archives_link()

来源(作者):互联网   发布时间: 2019-11-26  游览次数:6次

Description

Retrieve archive link content based on predefined or custom code.

The format can be one of four styles. The 'link' for head element, 'option' for use in the select element, 'html' for use in list (either ol or ul HTML elements). Custom content is also supported using the before and after parameters.

The 'link' format uses the link HTML element with the archives relationship. The before and after parameters are not used. The text parameter is used to describe the link.

The 'option' format uses the option HTML element for use in select element. The value is the url parameter and the before and after parameters are used between the text description.

The 'html' format, which is the default, uses the li HTML element for use in the list HTML elements. The before parameter is before the link and the after parameter is after the closing link.

The custom format uses the before parameter before the link ('a' HTML element) and the after parameter after the closing link tag. If the above three values for the format are not used, then custom format is assumed.

Usage

<?php get_archives_link( $url, $text, $format, $before, $after ); ?>

Parameters

$url
(string) (required) URL to archive.
Default: None
$text
(string) (required) Archive text description.
Default: None
$format
(string) (optional) Optional, default is 'html'. Can be 'link', 'option', 'html', or custom.
Default: html
$before
(string) (optional) Optional.
Default: empty string
$after
(string) (optional) Optional.
Default: empty string

Return Values

(string)
HTML link content for archive.

本文版权归原作者所有,转载请注明原文来源出处, WordPress教程网 感谢您的支持!

本文链接: http://www.wpabc.net/806.html

WordPress教程网
WordPress教程网
相关内容