enter image description here

I am developing a theme for our organisation, I have developed the following shortcode that generates a card view.

public function omnizzCard( $atts, $content = "" )
{
    $atts = shortcode_atts( array(
        'width' => '20 rem',
        'icon' => 'face',
        'title' => 'Card title'
    ), $atts, 'omnizz_card' );


    ob_start();
    include_once('shortcode_templates/card.php');
    return ob_get_clean();
}

shortcode_templates/Card.php

<div class="card" style="width: 20rem;">
    <div class="card-block text-center">
        <div class="">
            <i class="material-icons md-48"><?php echo $atts['icon'] ?></i>
        </div>
        <h4 class="card-title"><?php echo $atts['title'] ?></h4>
        <p class="card-text"><?php echo do_shortcode( $content ) ?></p>
    </div>
</div>

I am applying the shortcode like following:

But it showing single card not the second.

I also checked to inspect element on the chrome, its only displaying the single card element not the second one.

Can anyone help me to find out what wrong i have done?

Read more here: Same Shortcode not executing second time


Solution:

If you know the solution of this issue, please leave us a reply in Comment section, to update the question.


Wordpress related questions and answers: