Quantcast
Channel: help – WordPress.org Forums
Viewing all articles
Browse latest Browse all 13924

vtxyzzy on "Help with some php"

$
0
0

This is untested, but you could add another parameter to your shortcode to contain the URL of the link:

[team][team_member name='Michael Peacock' img='http://tdp-arch.com/wp-content/uploads/2012/11/michael1.jpg'  position='Intern Architect']url='http://mysite.com/profiles/mpeacock' [/team_member][/team]

and modify the code to use that URL:

function team_member( $atts, $content = null  ) {
		extract( shortcode_atts( array(
		'name' => '',
		'position' => '',
		'img' => '',
		'url' => '',
	), $atts ) );
	$return = '
<li>';
	if ($url) $return .= '<a href="'.$url.'" >';
	$return .= '<img class="imgWithBorder" src="'.$img.'" alt="" />';
	if ($url) $return .= '</a>';
	$return .= '<p>'.$name.' <span>'.$position.'</span></p>';
	$return .= '</li>
';		

	return $return;
}

Viewing all articles
Browse latest Browse all 13924

Trending Articles