WordPress.org

Ready to get started?Download WordPress

Forums

WP LinkedIn
[resolved] No profile picture on recommendations (6 posts)

  1. beer78
    Member
    Posted 7 months ago #

    I like your recommendations widget. Thanks,

    I have two questions. My website won't show the linkedin profile picture of the person who wrotes the recommendation. and sometimes the name and link to the person is not displayed.

    I have seen (recommendations.php):
    <a>recommender->publicProfileUrl); ?>"

    and i have entered 10000 characters for the length in the widget settings

    http://www.hoffoto.nl

    http://wordpress.org/plugins/wp-linkedin/

  2. Claude Vedovini
    Member
    Plugin Author

    Posted 7 months ago #

    My website won't show the linkedin profile picture of the person who wrotes the recommendation.

    The default template doesn't show the recommender's picture, you'll need to write a custom template to do that. See that article.

    sometimes the name and link to the person is not displayed.

    because their LinkedIn profile is not public. (recommender->publicProfileUrl is not defined)

  3. beer78
    Member
    Posted 7 months ago #

    Allright I will understdand the public profile issue (stupid me)

    But i'm still working on the picture issue. I've read your article of adding the php files to my profile. It's done. In the article is also written to add some lines in the recoomendations.php file. Thats'done too.

    But still no picture. The picture is public.

    My code is like:

    <?php
    	wp_enqueue_script('responsive-scrollable');
    	shuffle($recommendations);
    ?>
    <div class="linkedin">
    	<div class="scrollable"
    		data-width="<?php echo $width; ?>" data-interval="<?php  echo $interval; ?>"
    		style='width:<?php echo (is_numeric($width)) ? "{$width}px" : '100%'; ?>'>
    		<div class="items">
    
    <div class="recommender"><a href="<?php echo $recommendation- rel="nofollow">recommender->publicProfileUrl; ?>"
        target="_blank"><?php echo $recommendation->recommender->firstName; ?> <?php echo $recommendation->recommender->lastName; ?></a>
        <?php if (isset($recommendation->recommender->headline)) echo ' - ' . $recommendation->recommender->headline; ?>
    </div>
    
    		<?php foreach ($recommendations as $recommendation): ?>
    			<blockquote>
    				<div class="recommendation"><?php echo nl2br(wp_linkedin_excerpt($recommendation->recommendationText, $length)); ?></div>
    				<div class="recommender"><?php if (isset($recommendation->recommender->publicProfileUrl)): ?>
    					<a href="<?php echo esc_url($recommendation->recommender->publicProfileUrl); ?>"
    						target="_blank"><?php echo $recommendation->recommender->firstName; ?>
    						<?php echo $recommendation->recommender->lastName; ?></a>
    					<?php else: ?>
    					<?php _e('Anonymous', 'wp-linkedin'); ?>
    				<?php endif; ?></div>
    			</blockquote>
    		<?php  endforeach; ?>
    		</div>
    	</div>
    </div>
  4. Claude Vedovini
    Member
    Plugin Author

    Posted 7 months ago #

    ok, I see the problem. I though you were talking about the profile.

    right now you can customize the template of the recommendations widget but you cannot add other fields. You would need to add the recommender's picture and headline to the list of fields that are fetched but this list is not editable (unless you directly edit the plugin's file, but this is not recommended and I am not even sure the API would provide them)

  5. Claude Vedovini
    Member
    Plugin Author

    Posted 7 months ago #

    However, if you add the following line in your wp-config.php file you should be able to override that list. If you are in debug mode you will get a Notice from PHP because that constant is redefined in the plugin but it shouldn't affect you in any way

    define('LINKEDIN_FIELDS_RECOMMENDATIONS', 'recommendations-received:(recommendation-text,recommender:(first-name,last-name,public-profile-url,headline,picture-url))');

    however there are errors in the PHP code you posted

  6. Claude Vedovini
    Member
    Plugin Author

    Posted 7 months ago #

    closing

Reply

You must log in to post.

About this Plugin

About this Topic

Tags