• Resolved AztechXX

    (@aztechxx)


    Dear Mr Vedovini,

    I would like to display my certifications.

    From the documentation provided , I understood that I had first to define these added fields that have to be fetched from LinkedIn.

    Based on the list available here :https://developer.linkedin.com/docs/fields/certifications I set the following fields in the Profile fields in your plugin options:

    summary, certification:(name,start-date,end-date,number), specialties, languages, skills, educations, positions, recommendations-received:(recommendation-text,recommender:(first-name,last-name,public-profile-url))

    Then I went into “/wp-content/plugins/wp-linkedin/templates” and created a “profile-certifications.php” based on the education template file .
    I know nothing about php , so I tried and by replacing some part of code I did this :

    <div id="educations" class="section">
    <div class="heading"><?php _e('Certifications', 'wp-linkedin'); ?></div>
    <?php foreach ($profile->certifications->values as $v): ?>
    <div class="education">
    	<div class="school"><strong><?php echo $v->name; ?></strong> (<?php echo $v->start-date>year; ?> - <?php echo isset($v->end-date) ? $v->end-date->year : __('Present', 'wp-linkedin'); ?>) - <?php echo $v->number; ?></div>
    
    	<?php endif; ?>
    </div>
    <?php endforeach; ?>
    </div>

    and save it there.

    Unfortunatly , it does not do the job and this
    [li_profile fields="educations, certifications" lang="fr"]

    only provide the education field and not the certifications as well.

    I’m sorry for this very long message , but would you have a kitchen recipe for a non develloper guy like me to succeeed ?

    Thanks a lot in advance for any help or advice

    https://ww.wp.xz.cn/plugins/wp-linkedin/

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author Claude Vedovini

    (@cvedovini)

    Hi,

    You’re not so far actually, the only thing you overlooked is that the template that is loaded is profile.php (which in turns loads the different sections) so you also have to modify that one to include the new section.

    However it’s no recommend that you modify the files in the plugin because they will be overwritten when you update it, Instead, create a “linkedin” folder in your theme (may be create a sub-theme to host it) and put the modified and new templates in that folder.

    If you have problems figuring out the data structure that the API is sending back then you can use the print_r function to output the $profile->certifications. For example:

    <pre><?php print_r($profile->certifications); ?></pre>
    Thread Starter AztechXX

    (@aztechxx)

    Dear Mr Vedovoni,

    Thanks a lot for your fast reply,

    I added a subfolder named “linkedin” in my theme (/wp-content/themes/Divi/linkedin) and placed there the certifications.php + the profile.php that i edited for the certification part.

    Things are improving, thanks to your advice, and to my big surprise, I succeeded to list the certification names but I can’t succeed to have the licence numbers and the starting and ending date.

    This is my humble code now :

    <div id="educations" class="section">
    <div class="heading"><?php _e('Certifications', 'wp-linkedin'); ?></div>
    <?php foreach ($profile->certifications->values as $v): ?>
    <div class="education">
    
    	<div class="school"><strong><?php echo $v->name; ?></strong> - <?php echo $v->start-date>year; ?> / <?php echo $v->end-date>year; ?> - <?php echo $v->number; ?></div>
    
    </div>
    <?php endforeach; ?>
    </div>

    I tried you command (“print_r”) and this is the output :

    stdClass Object
    (
        [_total] => 2
        [values] => Array
            (
                [0] => stdClass Object
                    (
                        [id] => 9
                        [name] => Prince 2 Foundation
                    )
    
                [1] => stdClass Object
                    (
                        [id] => 10
                        [name] => Project Management Foundation with Prince2 and IPMA
                    )
    
            )
    
    )

    If you allow me a last request, would you have an idea on how to get these elements:
    – certification number => the field is suppose to be “number”
    – the start and ending dates => the field output “0” or nothing if I had “>year” after the variable name.

    Thaks in advance for any advance you may have and thanks again for the help provided especially taking into account that I’m like a guy trying to walk in a dark night as I have no knowledge in php …

    Plugin Author Claude Vedovini

    (@cvedovini)

    Normally, according to the LinkedIn documentation, if you use certification:(name,start-date,end-date,number) to request the fields, you should get what you provided in your profile.

    If it doesn’t work it means there’s an error in the documentation or in the API. In that case you will need to take it to their forums to ask for help. Although if the fields are incorrect the API should return an error.

    so if you’re using the shortcode with attributes then make sure it’s

    [li_profile fields="certification:(name,start-date,end-date,number)" lang="fr-FR"]

    (notice the language code too)

    Thread Starter AztechXX

    (@aztechxx)

    I give up . It does not work. So I suppose that the API is not documented properly or that I did a mistake I still don’t understand .

    Nevertherless , thanks for your help Mr Vedovoni and thanks for your plugin that works very well for all the rest .

    Plugin Author Claude Vedovini

    (@cvedovini)

    what’s your profile url on LinkedIn?

Viewing 5 replies - 1 through 5 (of 5 total)

The topic ‘Display LinkedIn certifications’ is closed to new replies.