1. You should open file acf.php in directory wp-content\themes\case\includes\
a) add this code
array (
‘default_value’ => ”,
‘formatting’ => ‘html’,
‘key’ => ‘field_51dfg53df56’,
‘label’ => ‘Custom link’,
‘name’ => ‘person_custom_link’,
‘type’ => ‘text’,
‘instructions’ => ‘Insert custom link beginning with http://’,
‘default_value’ => ‘#’,
‘formatting’ => ‘html’,
‘maxlength’ => ”,
),
after this part of code
array (
‘default_value’ => ”,
‘formatting’ => ‘html’,
‘key’ => ‘field_51dfg53df11’,
‘label’ => ‘Person position’,
‘name’ => ‘person_position’,
‘type’ => ‘text’,
),
2. Than go to menu Appearance -> Editor and edit this file
section-team.php
Find this part of code
$thumb = wp_get_attachment_image_src(get_post_thumbnail_id($post->ID), ‘medium’); $person_image = has_post_thumbnail($post->ID) ? ‘<div class=”team-cross-hover”><a href=”#” class=”cursor”><img src=”‘ . $thumb[0] . ‘” alt=”Team member” /></a><div class=”team-cross”></div></div>’ : ”;
and replace it with this one
$thumb = wp_get_attachment_image_src(get_post_thumbnail_id($post->ID), ‘medium’); $person_image = has_post_thumbnail($post->ID) ? ‘<div class=”team-cross-hover”><a class=”cursor”><img src=”‘ . $thumb[0] . ‘” alt=”Team member” /></a><a href=”‘ . get_field(‘person_custom_link’) . ‘”><div class=”team-cross”></div></a></div>’ : ”;
Now you can add custom link to team member’s photo in editor
0 Comments