Warning: Undefined array key "taxonomy" in D:\wwwroot\www.s-noni.cn\wp-content\plugins\wpjam-basic\public\wpjam-thumbnail.php on line 91
wordpress短代码、简码添加链接 - Ishop wordpress短代码、简码添加链接 - Ishop
Warning: Undefined array key "taxonomy" in D:\wwwroot\www.s-noni.cn\wp-content\plugins\wpjam-basic\public\wpjam-thumbnail.php on line 91
移动端手指操控左右滑动的菜单
<
Warning: Undefined array key "taxonomy" in D:\wwwroot\www.s-noni.cn\wp-content\plugins\wpjam-basic\public\wpjam-thumbnail.php on line 91
data-elementor-type="single-post" data-elementor-id="2362" class="elementor elementor-2362 elementor-location-single post-15999 post type-post status-publish format-standard hentry category-wordpress ast-article-single" data-elementor-post-type="elementor_library">
Facebook
Twitter
LinkedIn

wordpress短代码、简码添加链接


Warning: Undefined array key "taxonomy" in D:\wwwroot\www.s-noni.cn\wp-content\plugins\wpjam-basic\public\wpjam-thumbnail.php on line 91

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】

发表评论

购物车
加微信
Home
0
Cart
微信服务
个人中心
Cart