How Can We Help?

Overriding Shortcode Templates in Pay For Post with WooCommerce

You are here:
← All Topics

All shortcode templates are located in /plugins/woocommerce-pay-per-post/public/partials/ you can copy any of the files listed there to your theme/child-theme directory at /your-theme/woocommerce-pay-per-post/

Example

If you wanted to change the You have not purchased any protected posts text that is in the shortcode-purchased.php template you would do the following.

Copy /plugins/woocommerce-pay-per-post/public/partials/shortcode-purchased.php and put it into /your-theme/woocommerce-pay-per-post/shortcode-purchased.php

You could then change the template to look something like this.

<div class="wc-ppp-purchased-container">
  <?php if ( count( $purchased ) > 0 ) : ?>
        <ul id="what-ever-you-want">
      <?php foreach ( $purchased as $post ) : ?>
                <li>
                    <a href="<?php echo esc_url( get_permalink( $post->ID ) ); ?>"><?php echo esc_html( $post->post_title ); ?></a>
                </li>
      <?php endforeach; ?>
        </ul>
  <?php else : ?>
        <p><?php esc_attr_e( 'YOU CHANGED THIS TEXT TO BE WHATEVER YOU WANT.', 'wc_pay_per_post' ); ?></p>
  <?php endif; ?>
</div>