Hi @pavarnos,
Sorry to hear of the problem you are having.
This is a simple PHP warning and most of the time it doesn’t affect any functionality so it is nothing to worry about!
Do you have WP_DEBUG set to true in your wp-config.php file?
If you do then please set it to false.
This will hide the warning messages and you will be able to use your site normally.
Could you please share me the screenshot of warning message that you are getting or page link where it is displaying so that i can troubleshoot it?
For screenshots, you can simply provide a link to an image through Google Drive, Dropbox, screencast.com, http://imgur.com/ or other image service. 🙂
Kind Regards,
WPMU DEV
Hi
See my other bug report: WP_DEBUG is on, E_ALL | E_STRICT for error reporting.
Screenshot images as requested.
http://imgur.com/bJwsFfk and http://imgur.com/PcgDCUb
thanks very much for your help
PS did you notice the other bug? The course outline is not displaying under the course heading. Your intro video on your side shows that the structure of the course (units and pages) will be displayed under the “Course Outline” title on the detail page.
thanks
Hi @pavarnos,
Thank you for sharing the screenshot.
I could reproduce this warning message on my test site by disabling avatar from Discussion Settings therefore i have notified the plugin developer to fix it.
In the meanwhile to resolve this warning message could you please try editing the following code on line number 96 in the coursepress theme file content-course-overview.php
Before Editing :
<div id="instructor-profiles">
<?php
foreach ( $instructors as $instructor ) {
?>
<h3><?php echo $instructor->display_name; ?></h3>
<?php
$doc = new DOMDocument();
$doc->loadHTML(get_avatar($instructor->ID, 235));
$imageTags = $doc->getElementsByTagName('img');
foreach ( $imageTags as $tag ) {
$avatar_url = $tag->getAttribute('src');
}
?>
<div>
<img src="<?php echo $avatar_url; ?>" />
<p>
<?php echo author_description_excerpt($instructor->ID, 50); ?>
</p>
<a href="<?php echo do_shortcode('[instructor_profile_url instructor_id="' . $instructor->ID . '"]'); ?>" class="full-instructor-profile"><?php _e('View Full Profile'); ?></a>
</div>
<?php } ?>
</div>
After Editing :
<div id="instructor-profiles">
<?php
foreach ( $instructors as $instructor ) {
?>
<h3><?php echo $instructor->display_name; ?></h3>
<div>
<?php
$doc = new DOMDocument();
if( get_avatar($instructor->ID, 235) != '' ){
$doc->loadHTML(get_avatar($instructor->ID, 235));
$imageTags = $doc->getElementsByTagName('img');
foreach ( $imageTags as $tag ) {
$avatar_url = $tag->getAttribute('src');
}?>
<img src="<?php echo $avatar_url; ?>" />
<?php }else{
echo "<p>Profile avatar is not set.</p>";
}
?>
<p>
<?php echo author_description_excerpt($instructor->ID, 50); ?>
</p>
<a href="<?php echo do_shortcode('[instructor_profile_url instructor_id="' . $instructor->ID . '"]'); ?>" class="full-instructor-profile"><?php _e('View Full Profile'); ?></a>
</div>
<?php } ?>
</div>
Best Regards,
WPMU DEV
Hi @pavarnos,
PS did you notice the other bug? The course outline is not displaying under the course heading. Your intro video on your side shows that the structure of the course (units and pages) will be displayed under the “Course Outline” title on the detail page.
Could you please also share us the screenshot of this issue and tell us exactly which video you are referring so that we can test it?
Regards,
WPMU DEV