Images

Home Forums Chit Chat WPLMS customizations Images

Viewing 13 posts - 1 through 13 (of 13 total)
  • Author
    Posts
  • #389424
    Joseph Thomas
    Participant

    1- How can I show up the features images for the courses in the MEGA MENU?

    2- How Can I replace the PICSUM.com image with a custom image?

     


     


    #389435
    Anshuman Sahu
    Keymaster

    edit course and set course featured image : https://www.youtube.com/watch?v=gIxv_-15ro8

    #389467
    Joseph Thomas
    Participant
    This reply has been marked as private.
    #389475
    Anshuman Sahu
    Keymaster

    please refer video : https://somup.com/c0QXoTAJR3

    #389476
    Joseph Thomas
    Participant
    This reply has been marked as private.
    #389493
    Anshuman Sahu
    Keymaster

    add this code in your wplms-customizer.php file in wplms customizer plugin :



     add_shortcode('course_featured',array($Vibe_Define_Shortcodes,'course_featured'));

     add_action('init',function(){
     if(class_exists('Vibe_Define_Shortcodes')){
     $init = Vibe_Define_Shortcodes::init();
      remove_shortcode('course_featured',array($init,'course_featured'));
       add_shortcode('course_featured','course_featured2');
    }

    });

    function course_featured($atts,$content=null){
            extract(shortcode_atts(array(
              'width'   => '100%',
              'radius'  => '5px',
              'settings'=>'',
              'align'   =>'center'
            ), $atts));

            $className='';
            $a = explode('=',$settings);
            if(!empty($a) && is_Array($a) && !empty($a[1])){
                $className = $a[1];
            }

            $id = apply_filters('elementor_course_block_id','');
            if(empty($id))
                return;

            $image = get_the_post_thumbnail_url($id,'big');
            if(empty($image)){
                $image = 'https://training.pointcomfort.com/wp-content/uploads/2023/09/default_course_avatar.png';//add your default image url here
            }
            $html ='<div class="course_featured '.$align.' '.$className.'" style="position:relative;">';

            $html .= '<div class="'.$className.'" style="
          '.(is_numeric($width)?'width:'.$width.'px;':$width).';
          border-radius:'.(is_numeric($radius)?$radius.'px':$radius).'" ><img src="'.$image.'" /></div>';
            $html .= '</div>';
            return $html;
        }
    #389496
    Anshuman Sahu
    Keymaster

    after adding the code please add a default course image in your media library from wp-admin -> media .

    upload an image exatly named as " default_course_image.png "


    download the plugin here : https://wplms.io/support/wp-content/uploads/2023/08/wplms-customizer.zip


    #389509
    Joseph Thomas
    Participant
    This reply has been marked as private.
    #389523
    Anshuman Sahu
    Keymaster

    there is little mistake on code : 



    add this code in your wplms-customizer.php file in wplms customizer plugin :

    add_shortcode('course_featured',array($Vibe_Define_Shortcodes,'course_featured'));

    add_action('init',function(){
    if(class_exists('Vibe_Define_Shortcodes')){
    $init = Vibe_Define_Shortcodes::init();
    remove_shortcode('course_featured',array($init,'course_featured'));
    add_shortcode('course_featured','course_featured2');
    }

    });

    function course_featured2($atts,$content=null){
    extract(shortcode_atts(array(
    'width'   => '100%',
    'radius'  => '5px',
    'settings'=>'',
    'align'   =>'center'
    ), $atts));

    $className='';
    $a = explode('=',$settings);
    if(!empty($a) && is_Array($a) && !empty($a[1])){
    $className = $a[1];
    }

    $id = apply_filters('elementor_course_block_id','');
    if(empty($id))
    return;

    $image = get_the_post_thumbnail_url($id,'big');
    if(empty($image)){
    $image = 'https://training.pointcomfort.com/wp-content/uploads/2023/09/default_course_avatar.png';//add your default image url here
    }
    $html ='<div class="course_featured '.$align.' '.$className.'" style="position:relative;">';

    $html .= '<div class="'.$className.'" style="
    '.(is_numeric($width)?'width:'.$width.'px;':$width).';
    border-radius:'.(is_numeric($radius)?$radius.'px':$radius).'" ><img src="'.$image.'" /></div>';
    $html .= '</div>';
    return $html;
    }
    #389533
    Joseph Thomas
    Participant
    This reply has been marked as private.
    #389576
    Anshuman Sahu
    Keymaster

    Hi I would need ftp credentials in private reply in order to add the code in your site since adding it from plugins editor is not working : 



    BTW this is the correct and test code : 



    add_action('init',function(){
    if(class_exists('Vibe_Define_Shortcodes')){
    $init = Vibe_Define_Shortcodes::init();
    remove_shortcode('course_featured',array($init,'course_featured'));
    add_shortcode('course_featured','course_featured2');
    }

    });

    function course_featured2($atts,$content=null){
    extract(shortcode_atts(array(
    'width'   => '100%',
    'radius'  => '5px',
    'settings'=>'',
    'align'   =>'center'
    ), $atts));

    $className='';
    $a = explode('=',$settings);
    if(!empty($a) && is_Array($a) && !empty($a[1])){
    $className = $a[1];
    }

    $id = apply_filters('elementor_course_block_id','');
    if(empty($id))
    return;

    $image = get_the_post_thumbnail_url($id,'big');
    if(empty($image)){
    $image = 'https://training.pointcomfort.com/wp-content/uploads/2023/09/default_course_avatar.png';//add your default image url here
    }
    $html ='<div class="course_featured '.$align.' '.$className.'" style="position:relative;">';

    $html .= '<div class="'.$className.'" style="
    '.(is_numeric($width)?'width:'.$width.'px;':$width).';
    border-radius:'.(is_numeric($radius)?$radius.'px':$radius).'" ><img src="'.$image.'" /></div>';
    $html .= '</div>';
    return $html;
    }
    #389603
    Joseph Thomas
    Participant
    This reply has been marked as private.
    #389616
    Anshuman Sahu
    Keymaster

    You are right this code is not working anymore with latest version of wplms plugn , please remove that code. 

    add this code in your wplms-customizer.php file in wplms customizer plugin :

    add_shortcode('course_featured2','course_featured2');

    function course_featured2($atts,$content=null){
    extract(shortcode_atts(array(
    'width'   => '100%',
    'radius'  => '5px',
    'settings'=>'',
    'align'   =>'center'
    ), $atts));

    $className='';
    $a = explode('=',$settings);
    if(!empty($a) && is_Array($a) && !empty($a[1])){
    $className = $a[1];
    }

    $id = apply_filters('elementor_course_block_id','');
    if(empty($id))
    return;

    $image = get_the_post_thumbnail_url($id,'big');
    if(empty($image)){
    $image = 'https://training.pointcomfort.com/wp-content/uploads/2023/09/default_course_avatar.png';//add your default image url here
    }
    $html ='<div class="course_featured '.$align.' '.$className.'" style="position:relative;">';

    $html .= '<div class="'.$className.'" style="
    '.(is_numeric($width)?'width:'.$width.'px;':$width).';
    border-radius:'.(is_numeric($radius)?$radius.'px':$radius).'" ><img src="'.$image.'" /></div>';
    $html .= '</div>';
    return $html;
    }


    after this please goto wp-admin - vibebp-> course card => edit the topmost course card in elementor and in place of course featured block please add this shortcode : 

    [course_featured2 width="100%"]
Viewing 13 posts - 1 through 13 (of 13 total)
  • You must be logged in to reply to this topic.