WP LinkedIn
[resolved] Codes for displaying Projects section (4 posts)

  1. Wan-rong Jih
    Posted 1 year ago #

    Thank you for supporting this plugin.
    Even though the linkedIn API document of Profile Fields does not contain information of Projects fields, I find a way to show the projects data.

    There two parts should be changed:

    • plugin setting: for making this plugin can retrieve project data.
    • php codes: add some codes in order to show the data.

    For the plugin setting of profile fields, add the following:

    projects:(name, start-date, end-date, members:(person:(first-name, last-name), name), description)

    In addition, the following codes should be added to the profile.php

    <?php if (isset($profile->projects->values) && is_array($profile->projects->values)): ?>
    <div id="projects" class="section">
    <div class="heading"><?php _e('Projects', 'wp-linkedin'); ?></div>
    <?php foreach ($profile->projects->values as $v): ?>
    <div class="projects">
    <div class="name"><?php echo $v->name; ?>
    <?php if (isset($v->startDate)): ?>
    (<?php echo $v->startDate->year; ?> - <?php echo isset($v->endDate) ? $v->endDate->year : __('Present', 'wp-linkedin'); ?>)
    <?php endif; ?>
    <?php if (isset($v->members)): ?>
    <p>Team members:
    <?php $members = array();
    foreach ($v->members->values as $m) {
    if (isset($m->name)) {
    $members[] = '<span class="member">'. $m->name . '</span>';
    else {
    $members[] = '<span class="member">'. $m->person->firstName . ' ' . $m->person->lastName . '</span>';
    echo implode(', ', $members);
    <?php endif; ?>
    <?php if (isset($v->description)): ?>
    <div class="summary"><?php echo wpautop($v->description); ?></div>
    <?php endif; ?>
    <?php endforeach; ?>
    <?php endif; ?>

    I'm not familiar with php, please feel free to make it better.


  2. Claude Vedovini
    Plugin Author

    Posted 1 year ago #

    oh wow, that's awesome! thank you very much, I will add that to next release :)

  3. Wan-rong Jih
    Posted 1 year ago #

    should give my thanks for your help about my previous questions. Your support make me have more understanding about this plugin. In addition, this thread of LinkedIn Forum (#19 from Jan Garaj) also gives some ideas for me.

    I'm not familiar with website programming, so, I'm very happy can find this solution. :-D

    Looking forward to the new release.

  4. Claude Vedovini
    Plugin Author

    Posted 1 year ago #

    released a slightly different version in 1.13, you can check it out here http://vedovini.net/about/

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • WP LinkedIn
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic


No tags yet.