Link employees and contributors/writers

Hi.
We use Moesia as a template for our professional blog and created the employees page with our pics. But contributors and employees are the same people and i’d like to link their profile on the employee page with the articles they wrote. How can I do that please?

Hello there,

Thank you for reaching out to us here.

In order to achieve that objective, could you please try to do the following?

  1. Edit the widgets/fp-employees.php file
  2. Insert this code right after $linkedin = get_post_meta( get_the_ID(), 'wpcf-linkedin', true ); line

$customlink = get_post_meta( get_the_ID(), 'wpcf-custom-link', true );

  1. Replace the following code block:

<?php if ($photo != '') : ?>
	<img class="employee-photo wow zoomInDown" src="<?php echo esc_url($photo); ?>" alt="<?php the_title(); ?>">
<?php elseif ( has_post_thumbnail() ) : ?>
	<div class="employee-photo wow zoomInDown"><?php the_post_thumbnail('moesia-employees-thumb'); ?></div>
<?php endif; ?>
<h4 class="employee-name wow fadeInUp"><?php the_title(); ?></h4>
<?php if ($position != '') : ?>
	<span class="employee-position wow fadeInUp"><?php echo esc_html($position); ?></span>
<?php endif; ?>
<div class="employee-desc wow fadeInUp"><?php the_content(); ?></div>

with:


<?php if($customlink){ ?><a href="<?php echo esc_url($customlink); ?>"><?php } ?>

  <?php if ($photo != '') : ?>
  	<img class="employee-photo wow zoomInDown" src="<?php echo esc_url($photo); ?>" alt="<?php the_title(); ?>">
  <?php elseif ( has_post_thumbnail() ) : ?>
  	<div class="employee-photo wow zoomInDown"><?php the_post_thumbnail('moesia-employees-thumb'); ?></div>
  <?php endif; ?>
  <h4 class="employee-name wow fadeInUp"><?php the_title(); ?></h4>
  <?php if ($position != '') : ?>
  	<span class="employee-position wow fadeInUp"><?php echo esc_html($position); ?></span>
  <?php endif; ?>
  <div class="employee-desc wow fadeInUp"><?php the_content(); ?></div>

<?php if($customlink){ ?></a><?php } ?>

  1. Apply the following CSS code through the Simple Custom CSS plugin or child theme’s style.css:

.employee > a{
  color: inherit;
}

.employee > a:hover{
  text-decoration: none;
}

  1. Edit your employee item (Dashboard > Employees)

  2. Go to “Employee info” box. In the field that says “Custom link”, enter the user archive URL which looks like:


http://yoursite.com/author/username/

Replace username with the author user name.

This is just information: as you are editing the core theme’s file, you should take it at your own risk. The change you’ve made in the widgets/fp-employees.php will be lost once the theme gets updated in the future.

I hope this reply helps.

Regards,
Kharis