移动端手指操控左右滑动的菜单
<
Facebook
Twitter
LinkedIn

wordpress短代码、简码添加链接

wordpress短代码、简码添加链接

1、在php文件中插入链接

 

				
					//代码原始文件
<?php
global $current_user;
    get_currentuserinfo();
    echo '' . $current_user->user_login ;
?>
				
			
				
					//在echo添加链接
<?php
global $current_user;
get_currentuserinfo();
// echo '' . $current_user->user_login ;
echo '<a href="/my-account-infor/">' . $current_user->user_login . '</a>' ;
//'<a href="/my-account-infor/">' . do_shortcode( $content ) . '</a>';
?>
				
			
				
					//百度文档
function add_url_shortcode( $atts, $content = null ) {
	$a = shortcode_atts( array(
			'url' => '#',
	), $atts );

	return '<a href="' . esc_url( $a['url'] ) . '">' . do_shortcode( $content ) . '</a>';
}

add_shortcode( 'url', 'add_url_shortcode' );

				
			

2、在functions.php文件中调用

				
					/**** 
 * 调用用户名称* 
 ***/
function do_shortcode_user_Loginname($atts, $content = null) {
	include('short_code/UserLoginname.php');
	return '';
}
add_shortcode('user_Loginname', 'do_shortcode_user_Loginname');
				
			

2、在显示文件中调用

【user_Loginname】

发表评论

购物车
微信客服
首页
0
购物车
微信服务
个人中心
支付