Title: Another Dynamic Content Problem
Last modified: August 22, 2016

---

# Another Dynamic Content Problem

 *  Resolved [kirkward](https://wordpress.org/support/users/kirkward/)
 * (@kirkward)
 * [11 years, 8 months ago](https://wordpress.org/support/topic/another-dynamic-content-problem/)
 * I have a post using php to get user_meta. Here is the code.
 *     ```
       By <?php
       // Get the user ID
       $user_id = get_current_user_id();
         // echo $user_id ;
         $key1 = 'first_name';
         $key2 = 'last_name';
         $single = true;
         $user_first = get_user_meta( $user_id, $key1, $single );
         $user_last = get_user_meta( $user_id, $key2, $single );
         echo $user_first . ' ' . $user_last;
       ?>
       ```
   
 * The text prints properly in the wordpress post showing my information. However,
   when the pdf is created, the php looks for data for user 0 (zero) and omits the
   dynamic text.
 * I have set
    `define('DISABLE_PDF_CACHE', true);` in the wp-config.php file, and
   it has been working properly (I tested by change some text in the template).
 * Any suggestions? So far I’m really excited about this plugin. It looks like it
   may have some flexibility that I have been looking for.
 * [https://wordpress.org/plugins/wp-pdf-templates/](https://wordpress.org/plugins/wp-pdf-templates/)

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

 *  Plugin Author [Viljami Kuosmanen](https://wordpress.org/support/users/zuige/)
 * (@zuige)
 * [11 years, 7 months ago](https://wordpress.org/support/topic/another-dynamic-content-problem/#post-5313546)
 * Hi! Sorry for the late response.
 * You’re experiencing this probably because cookie headers that contain user login
   information are not being forwarded to the template.
 * You could try if `define('FETCH_COOKIES_ENABLED', true);` solves your problem.
 * Let me know if you still need assistance.
 * Cheers!
 *  Thread Starter [kirkward](https://wordpress.org/support/users/kirkward/)
 * (@kirkward)
 * [11 years, 7 months ago](https://wordpress.org/support/topic/another-dynamic-content-problem/#post-5313548)
 * No problem Antti – Thanks for the respnse.
 * I’ll be a week or two getting back to testing. We are going ahead and delivering
   our document in MSWord in the meantime, so as to get the subscribers something,
   at least.

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

The topic ‘Another Dynamic Content Problem’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/wp-pdf-templates_ffffff.svg)
 * [WordPress PDF Templates](https://wordpress.org/plugins/wp-pdf-templates/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/wp-pdf-templates/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/wp-pdf-templates/)
 * [Active Topics](https://wordpress.org/support/plugin/wp-pdf-templates/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/wp-pdf-templates/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/wp-pdf-templates/reviews/)

## Tags

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

 * 2 replies
 * 2 participants
 * Last reply from: [kirkward](https://wordpress.org/support/users/kirkward/)
 * Last activity: [11 years, 7 months ago](https://wordpress.org/support/topic/another-dynamic-content-problem/#post-5313548)
 * Status: resolved