• Resolved kirito127

    (@kirito127)


    Whenever I inserted snippet inside the class it just reads as text.

    This is the tag im working.
    <li class=”[insert_php] echo ([wbcr_php_snippet id=’11382′]==’cosmetics’?’active’:”); [/insert_php]”>Cosmetics

    Thanks

Viewing 1 replies (of 1 total)
  • Plugin Author webcraftic

    (@webcraftic)

    Hi,

    I’m sorry, I needed to update other plugins. Now I’m back to you and can help you.

    Create a snippet with the html code:

    ?>
    <li class="<?= ($my_var == 'cosmetics' ? 'active' : '') ?>">Cosmetics</li>

    Call the snippet using the shortcode in the editor:

    <ul>
      <li>Cosmetics</li>
      <li>Cosmetics</li>
      [wbcr_php_snippet id='11382']
      <li>Cosmetics</li>
    </ul>

    Best regards, Alex

Viewing 1 replies (of 1 total)
  • The topic ‘How to insert php snippet on html tag classes’ is closed to new replies.