• Please need help on how to create this template

    Template file not found at theme_path…/advanced-pdf-generator/apg-templates/pdf.php

Viewing 15 replies - 1 through 15 (of 17 total)
  • Same issue here, it’s not clear what to put in the file?

    same problem here – did anyone fix this?

    Plugin Author Juan Camilo

    (@jcmlmorav)

    There is an error in the path printed in the generated pdf when fail.

    Steps:

    1. Create the apg-templates at the root of the current theme
    2. Create a pdf.php file inside the apg-template directory
    3. Create a mail.php file inside the apg-template directory

    pdf.php must to have the php code to get all the info about the post or whatever you want to print in the pdf, for example:

    
    while(have_posts()): the_post()
    the_title()
    the_content()
    endwhile
    

    Hello
    I′m using a childtheme and the plugin needs to have the apg-templates inside the parent theme directory.

    Hi @elpezrojo,
    Same for me, can you tell me what’s happening when you view or print ?
    For me, the pdf file contains only the code, not the content of the post
    while(have_posts()): the_post() the_title() the_content() endwhile
    is it the same for you ?

    I still dont undestand and it did not work.
    Anyone please?

    Me too, I’m doing what is wrote, still didn’t work.

    I already did all of the things, and it gave me 505

    I found a better plugin, thanks!

    Can you give the name please?

    Hi mfoucault, you need to wrap the code in php tags. If you copy the following code in your pdf.php the plugin should work for you:

    <?php
    while ( have_posts() ) : the_post();
    the_title();
    the_content();
    endwhile;
    ?>

    Hi @cinematic
    I tried what you explained without result.

    I have a child theme, so I put the pdf.php in the mother theme folder:
    twentyseventeen/apg-templates

    When I refresh the website page, the page content doesn’t appears.

    You need to create the pdf file through the link “view”. A refresh with a pdf file won’t work. You need to create a new pdf.

    Thanks @cinematic
    Yes it’s what I’m done.
    So,
    I have put pdf.php in /wp-content/themes/twentyseventeen/apg-templates/
    When the code is

    <?php
    while ( have_posts() ) : the_post();
    the_title();
    the_content();
    endwhile;
    ?>;

    and i refresh the post I have an “HTTP ERROR 500”
    When I withdraw the
    <?php and ?>;
    I can show the post content, I haven’t this “HTTP ERROR 500”
    But when I clic on the “view” link the pdf file shows only the text “while ( have_posts() ) : the_post(); the_title(); the_content(); endwhile;”

    What I have missing ?

    There must not be a ; at the very end. The closing php tag is just ?>
    If you remove the last ; it should work.

    • This reply was modified 6 years, 1 month ago by cinematic.
Viewing 15 replies - 1 through 15 (of 17 total)
  • The topic ‘how create template pdf’ is closed to new replies.