Title: Shortcode
Last modified: August 5, 2020

---

# Shortcode

 *  Resolved [paulcottin](https://wordpress.org/support/users/paulcottin/)
 * (@paulcottin)
 * [5 years, 10 months ago](https://wordpress.org/support/topic/shortcode-758/)
 * To begin with, thanks for your plugin it helps me a lot.
    However, I have a question
   regarding the shortcodes. Indeed, I use a shortcode in the web page to display
   dynamic information. The pdf generated by your plugin does not take into account
   what the shortcodes return and only displays the name of the shortcode (Ex: [
   test]). I performed various tests including the do_shortcode () function but 
   nothing works. Do you have a solution or leads so that I can find some? maybe
   in which plugin file should I make changes?
 * The page I need help with: _[[log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fwordpress.org%2Fsupport%2Ftopic%2Fshortcode-758%2F%3Foutput_format%3Dmd&locale=en_US)
   to see the link]_

Viewing 3 replies - 1 through 3 (of 3 total)

 *  Plugin Author [fkrauthan](https://wordpress.org/support/users/fkrauthan/)
 * (@fkrauthan)
 * [5 years, 10 months ago](https://wordpress.org/support/topic/shortcode-758/#post-13220508)
 * What you can try todo is copy the default.php and default.css template shipped
   with the plugin to something custom. Then in the default.php find the string 
   that says
 * `wpautop($post->post_content, true)`
 * and replace it with
 * `wpautop(do_shortcode($post->post_content), true)`
 * and then select your new template in the wp-mpdf settings.
 *  Thread Starter [paulcottin](https://wordpress.org/support/users/paulcottin/)
 * (@paulcottin)
 * [5 years, 9 months ago](https://wordpress.org/support/topic/shortcode-758/#post-13303311)
 * Thank you for your answer but it’s doesn’t work.
 * Do you see an other solution ? If no, can you tell me if you think it’s possible
   with your plugin to see the return of the shortcode? If you think it’s impossible
   
   it will save me hours of working for nothing.
 * Thanks for advance.
    Paul
 *  Plugin Author [fkrauthan](https://wordpress.org/support/users/fkrauthan/)
 * (@fkrauthan)
 * [5 years, 9 months ago](https://wordpress.org/support/topic/shortcode-758/#post-13340301)
 * Sorry usually I get notifications even if a topic is marked as resolved. That
   is the only solution that I would have thought works. I never worked with shortcodes
   so my experience is limited with that. In theory what I suggested should have
   worked.
 * But did you correctly copy the template and selected the new template? You need
   to copy `default.{php,css}` into the directory `/wp-content/wp-mpdf-themes` with
   a new name (e.g. `mytemplate.{php,css}`) then edit that new PHP file (to add 
   my suggestion). And last but not least go to the settings page and select `mytemplate`
   as the new tempalte.

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘Shortcode’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/wp-mpdf.svg)
 * [wp-mpdf](https://wordpress.org/plugins/wp-mpdf/)
 * [Support Threads](https://wordpress.org/support/plugin/wp-mpdf/)
 * [Active Topics](https://wordpress.org/support/plugin/wp-mpdf/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/wp-mpdf/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/wp-mpdf/reviews/)

## Tags

 * [pdf](https://wordpress.org/support/topic-tag/pdf/)
 * [shortcode](https://wordpress.org/support/topic-tag/shortcode/)

 * 3 replies
 * 2 participants
 * Last reply from: [fkrauthan](https://wordpress.org/support/users/fkrauthan/)
 * Last activity: [5 years, 9 months ago](https://wordpress.org/support/topic/shortcode-758/#post-13340301)
 * Status: resolved