Forum Replies Created

Viewing 5 replies - 1 through 5 (of 5 total)
  • Thread Starter idonic

    (@idonic)

    You should place that in the pdf template you create.

    By default, template location is wp-content/wp-mpdf-themes/default.php.

    To costumize your pdf’s just create a copy of default.php (let’s say default_2.php), and edit it according to your needs.

    You are also required to make a copy of the default.css file in order to edit the styles of your template. (you have to name them the same: default_2.php and default_2.css)

    On the default.php file you’ll notice a page structure which then you can costumize according to your needs. And that is where you’ll use that piece of code to call forth the thumbnail’s featured image.

    As a temporary fix, while the plugin author doesn’t solve this, i managed to make it work with custom post types.

    On wp-most-popular/system/helpers.php simply change line 7 from:

    $post_type = 'post';

    to

    $post_type = 'my_custom_post_type_name';

    Thread Starter idonic

    (@idonic)

    To place a featured post image on the pdf file i’m using
    get_the_post_thumbnail( $post->ID, medium)

    Does that solve your issue?

    Thread Starter idonic

    (@idonic)

    Got it!

    . get_avatar( wp_get_current_user('user_email', $id), '252')

    I was waaaayy off on this one. ?? Now it dynamically loads the current user’s avatar on the pdf.

    Thanks again for your help.

    Thread Starter idonic

    (@idonic)

    Thanks for your reply!

    The css part is going ok but the php one doesn’t..

    I’m currently using the line below to dynamically load the current user’s avatar into the homepage header:

    <?php global $current_user; $current_user = wp_get_current_user(); _e(get_avatar($current_user)); ?>

    I was trying to get the same functionality to work with your plugin; it already displays the general avatar on the pdf but i can’t get it to make a distinction between users.. ??

    So far i’ve added these two lines to get the output mentioned:

    (top)
    global $current_user;

    <h1>' . $pdf_output .= (get_avatar('$avatar')) . '</h1>

    (yes, i’m really new to this “php stuff” :))
    Can you point me out on the right direction?

    Thanks again

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