Follow

How to add custom link to Team member’s photo

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

Was this article helpful?
0 out of 0 found this helpful
Have more questions? Submit a request

0 Comments

Please sign in to leave a comment.
Powered by Zendesk