Okay
  Public Ticket #3120835
Changing Course Card design
Closed

Comments

  • riseschooluk started the conversation

    I want to change the Course Card design. How can I do that?

    1161097031.png


  • [deleted] replied

    Well it can be changed by editing the page .Please share the page url where this is showing .

  •   riseschooluk replied privately
  • [deleted] replied

    edit page in elementor and then : https://prnt.sc/2WoKpeY7kb6m

  •   riseschooluk replied privately
  • [deleted] replied

    Well im sorry these cannot be edited . 

    you can add extra content using this hook : 


    add_filter('wplms_course_thumb_extras',function($html){

    $extrahtml = '<div class="course-more"><a href="'.get_permalink().'">See more</a></div>'; 

    return $html.$extrahtml.;

    });

  • riseschooluk replied
    1. where exactly to add this hook code?
    2. and after adding the hook where do I edit the newly added card design?
  • [deleted] replied

    You cannot create new design as I said you can only add some html to existing designs . for code please refer : https://wplms.io/support/knowledge-base/how-to-use-coding-tips/

  • riseschooluk replied

    Got you..

    but I'm unable to find out the exact class name/function name to change 'courseitem'.

    I want my course card to look like the image below. what exactly the code will look like?

    6678648103.png


  • [deleted] replied

    Well you cannot edit the courseitem class .

    what you can do is : 

    change this option to "Course card" : 

    5042466083.png

    then create your own card from wp-admin -> vibebp-> course card -> add new ,edit it with elementor . 



  • riseschooluk replied

    okay.

    but how do I change the option to "Course card" ?

    there isn't any option like that.

    Do I need to add any code somewhere?

  • [deleted] replied

    Please goto wp-admin -> vibebp-> course cards .The topmost course card loads there in the directory . 

    So edit that course or create new one which will load there .

  • riseschooluk replied

    I've created a new card named "Course Card",

    5389502246.png

    Yet I'm not getting any option as you said

    4347395995.png
  • riseschooluk replied

    Thanks.

    It worked.

  • riseschooluk replied

    Can you please tell me how can I set the "student_number", "price" and "discounted price" in the custom code?

    Like, "$post->post_title" is for the course title.. 

    7914753905.png


  • [deleted] replied

    can you please share the page url where this is coming up ?

  •   riseschooluk replied privately
  •   riseschooluk replied privately
  • [deleted] replied

    To change student mumber please check this value in backend edit course : 

    https://prnt.sc/xLPdPuKdu4Qc

    https://prnt.sc/Obd_K9H0d2hw

    price can be changed by editing course -> course pricing/accessibility settings 


  • riseschooluk replied

    I am sorry; I wanted to mean, "How can I SHOW "student number", "price" and "discounted price" in custom course card writing custom code...

    I need the hook that will show this informations in course card..

    Like, "$post->post_title"  show the "course title" in course card.. 

  • [deleted] replied

    Im not getting where do you want to show these info .

    these are already showing here : https://prnt.sc/VhFhWQh-S8t8

  • [deleted] replied

    IF you want to show custom card in vibe carousel then follow 

    https://wplms.io/support/knowledge-base/creating-custom-featured-block-style/

  • riseschooluk replied

    Yes, I've followed this tutorial.

    But the problem is in the given card, the price is not showing.

    Here card will show

    1. Post/Course Thumbnail[get_the_post_thumbnail($post->ID,'medium')]
    2. Post/Course title[$post->post_title]
    3. Anchor link of the post[get_permalink($post->ID)]

    Similarly, how can show the "price" and "discounted price"  on a custom card using this below code?

    function custom_vibe_featured_thumbnail_style($thumbnail_html,$post,$style){
        if($style == 'custom_block'){ //Custom block is the same name as added for the thumbnail in pagebuilder
            $thumbnail_html ='';
            $thumbnail_html .= '<div class="block customblock">';
            $thumbnail_html .= '<div class="block_media">';
            $thumbnail_html .= '<a href="'.get_permalink($post->ID).'">'.get_the_post_thumbnail($post->ID,'medium').'</a>';
            $thumbnail_html .= '</div>';
            $thumbnail_html .= '<div class="block_content">';
            $thumbnail_html .= '<h4 class="block_title"><a href="'.get_permalink($post->ID).'" title="'.$post->post_title.'">'.$post->post_title.'</a></h4>';
            $thumbnail_html .= '</div>';
        }
        return $thumbnail_html;
    }</div>
    

  • [deleted] replied
    function custom_vibe_featured_thumbnail_style($thumbnail_html,$post,$style){ if($style == 'custom_block'){ //Custom block is the same name as added for the thumbnail in pagebuilder $thumbnail_html =''; $thumbnail_html .= '
    '; $thumbnail_html .= '
    '; $thumbnail_html .= ''.get_the_post_thumbnail($post->ID,'medium').''; $thumbnail_html .= '
    '; $thumbnail_html .= '
    '; $thumbnail_html .= ''.$post->post_title.''; $pid= get_post_meta($post->ID,'vibe_product',true); if(!empty($pid)){ $product = wc_get_product($pid); $thumbnail_html .= ''.$product->get_regular_price().''; $thumbnail_html .= ''.$product->get_sale_price().''; } $thumbnail_html .= '
    '; } return $thumbnail_html; }