Link from a employee in Moesia

Hi,
I tried to set a link from the employee photo to the detail page of the employee but it didn’t work. After looking in this forum I tried to do it like the description below but nothing happen. How can I link the photo in Moesia? Alternativly I tried to set a custom link / custom url in the employee Info but even this doesn’t work. Could you please help me?
Thanks,
Regina

to enable the custom link for employee’s photo, you need to edit a file under theme folder > widgets > fp-employees.php then the first you need to add this line:
$custom_link = get_post_meta( get_the_ID(), ‘wpcf-custom-link’, true );
then under has_post_thumbnail() change this line:

<?php elseif ( has_post_thumbnail() ) : ?>
<div class=“employee-photo wow zoomInDown”><?php the_post_thumbnail(‘moesia-employees-thumb’); ?></div>
<?php endif; ?>

to:

<?php elseif ( has_post_thumbnail() ) : ?>
<?php if ( $custom_link != ‘’ ) : ?>
">
<?php endif; ?>
<div class=“employee-photo wow zoomInDown”><?php the_post_thumbnail(‘moesia-employees-thumb’); ?></div>
<?php if ( $custom_link != ‘’ ) : ?>

<?php endif; ?>
<?php endif; ?>

Hello Resmi,

Looks like you found the thread that discuss about how to add a link to the employee photo?

Please follow all the steps on those thread?

Hi Awan,

thanks, I just followed the instructions again but it doesn’t work. Here’s a part of the code: So what’s wrong with it?

Thanks for help,
Regina


		&lt;?php while ( $r-&gt;have_posts() ) : $r-&gt;the_post(); ?&gt;
				&lt;?php //Get the custom field values
					$photo = get_post_meta( get_the_ID(), 'wpcf-photo', true );
					$position = get_post_meta( get_the_ID(), 'wpcf-position', true );
					$facebook = get_post_meta( get_the_ID(), 'wpcf-facebook', true );
					$twitter = get_post_meta( get_the_ID(), 'wpcf-twitter', true );
					$google = get_post_meta( get_the_ID(), 'wpcf-google-plus', true );
					$linkedin = get_post_meta( get_the_ID(), 'wpcf-linkedin', true );

$custom_link = get_post_meta( get_the_ID(), ‘wpcf-custom-link’, true );
?>
<div class=“employee col-md-4 col-sm-6 col-xs-6”>
<?php if ($photo != ‘’) : ?>
<?php elseif ( has_post_thumbnail() ) : ?>
<?php if ( $custom_link != ‘’ ) : ?>
">
<?php endif; ?>
<div class=“employee-photo wow zoomInDown”><?php the_post_thumbnail(‘moesia-employees-thumb’); ?></div>
<?php if ( $custom_link != ‘’ ) : ?>

<?php endif; ?>
<?php endif; ?>
" alt="<?php the_title(); ?>">

					&lt;h4 class="employee-name wow fadeInUp"&gt;&lt;?php the_title(); ?&gt;&lt;/h4&gt;

Hi Resmi,

Your code is incorrect. You can try to use these code instead http://pastebin.com/rukC4Eqx

Hi Awan,
thanks a lot!! It works now on the homepage but it doesn’t work on the page which based on the Employees template… What do I have to do here?
If you like to see the site:
here it works:
http://wp.osteopathie-smit.de
here it doesn’t work (based on the employee-template)
http://wp.osteopathie-smit.de/unser-team/

And another question please: why does the detail page of the employee doesn’t show the picture?

Thanks,
Resmi

Hi,

The employee link is not working on the page template because its different file. You can download this file (page_employees.php) and put it to your child theme http://prntscr.com/9vbidl

Hi @Awan- your theme is great! Thanks for the work! … I’m a beginner and am having a fairly easy time, but this issue with the custom links for employee photo is out of my league. Can you help please? Many thanks from Bali!

@Awan, thanks. It works.
In line 48 in your script is a “sss”. I removed it and everything is doing well now.

@onenessid So you are from Bali? awesome! nice to know you! Late last year I was recently on vacation in Bali :slight_smile:
Okay, please follow this link https://athemes.com/forums/topic/employee-custom-link-not-working/ and this thread certainly to add a custom link to the employees photo. Feel free to ask if you need more help :slight_smile:

@resmi Thank you for the prompt! I’d like to remove it too from pastebin.

@Awan Nice! Maybe we surfed together!

Thanks for the response and for the link- but it looks like there are errors in the instructions. Is there are very clear coding instruction somewhere? I’m not running a child theme (as I don’t know how nor if it is best to do so) and want to be sure all remains clean. … Sorry for the newbie-ness…

Hello Awan!

First off… thank you for a great theme.
I also am having problems linking the employee photo. I have followed the instructions as best I can, but still no luck. I also referred to the other forum thread regarding this topic.

Here is a copy of the code now of my fp-employees.php

http://pastebin.com/qGs5bmSc

And here is a link to the website project I am working on:

http://www.welovesilliman.com/

Please, I need your help. Thanks!

@anapatrice I’ve checked your file and seems like you put the custom code in wrong place. see this http://prntscr.com/a6ry6b

I corrected my code Arwan but it still does not seem to work.

$linkedin = get_post_meta( get_the_ID(), ‘wpcf-linkedin’, true );
$custom_link = get_post_meta( get_the_ID(), ‘wpcf-custom-link’, true );
?>
<div class=“employee col-md-4 col-sm-6 col-xs-6”>
<?php if ($photo != ‘’) : ?>
<?php if ( $custom_link != ‘’ ) : ?>
">
<?php endif; ?>
" alt=" <?php the_title(); ?>">
<?php if ( $custom_link != ‘’ ) : ?>

<?php endif; ?>
<?php elseif ( has_post_thumbnail() ) : ?>
<?php if ( $custom_link != ‘’ ) : ?>
">
<?php endif; ?>
<div class=“employee-photo wow zoomInDown”><?php the_post_thumbnail(‘moesia-employees-thumb’); ?></div>
<?php if ( $custom_link != ‘’ ) : ?>

<?php endif; ?>
<?php endif; ?>

What could be wrong?

I copy pasted the code from the pastebin link you gave above because I was not sure anymore if I added unnecessary lines of codes.

http://pastebin.com/rukC4Eqx

But the link to the employee photo still does not work.

Can you create a temporary account for your wp admin and send it to my email awan.rimbawan101 at gmail? let me check your code.

Just did Awan. And big thanks!

Thank you @anapatrice

I’ve just logged in to your wordpress dashboard and check the fp-employees.php file, the custom code is correct but in functions.php you didn’t call those fp-employee.php file.

Currently, you are using Moesia child and you have to call/import the widget from the parent theme to your child theme. Please follow this step but please to modifying these file using FTP not from wordpress editor:

  1. add this line to the functions.php in your child theme:
if ( function_exists('siteorigin_panels_activate') ) {
	require_once get_template_directory() . "-child/widgets/fp-employees.php";
}
  1. open functions.php in the parent theme and change this line:
    require get_template_directory() . "/widgets/fp-employees.php";
    to:
    // require get_template_directory() . "/widgets/fp-employees.php";

Let me know how it goes.

For the time you are giving to assist me in my problem I thank you Awan. But I followed your instructions, the screen now becomes blank.

Hi,

I can access your site as well but the employee photo doesnt has a link. Did you using FTP to edit the files when you followed the instructions in above?

Hi Awan,

Yes, I used ftp. But when I refresh my website with the changes in place. I only get a blank screen.