首页 > 解决方案 > adding to PHP echo or styling

问题描述

I am trying to amend the custom layout from one of my WordPress plugins.

%1s and %2s below I would like to wrap in to add a class so that I can add some styling to this elements but am unsure how to do this

<?php if (!is_quote()) : ?>
      <p><?php echo sprintf(__('We have sent you invoice %1s with a balance of %2s.', ud_get_wp_invoice()->domain), invoice_id(array('return' => true)), balance_due(array('return' => true))); ?></p>
    <?php endif; ?>

I have tried breaking up and adding span as so:

<?php echo sprintf(__('We have sent you invoice' <span>'%1s'</span> 'with a balance of' <span>'%2s'</span>'.', ud_get_wp_invoice()->domain)...

but no joy, I have never tried anything like this so am unsure what options I have

标签: phphtmlwordpress

解决方案


推荐阅读