Home > Mobile >  how to add image in wordpress custom plugin?
how to add image in wordpress custom plugin?

Time:06-23

this is the directory of my project

Turover-calculator
  assets
    logo.png
  turnover-calculator.php


wp_mail($comEmail, $comName." turnover cost result ", "the total attrition cost of the ".$comName." is ".$currency.$result . '<img src = ' . plugins_url('/assets/logo.png', __FILE__) . ' style="height: 100%; width: 100%; object-fit: contain" alt="logo">');

logo.png not showing guess i call the img wrong

CodePudding user response:

try this one plugin_dir_url( __DIR__ )

$img_path = '<img src = ' . plugin_dir_url( __DIR__ ) . 'assets/logo.png' . ' style="height: 100%; width: 100%; object-fit: contain" alt="logo">';
wp_mail($comEmail, $comName." turnover cost result ", "the total attrition cost of the ".$comName." is ".$currency.$result . $img_path);
  • Related