WordPress.org

Forums

Post PDF Export
Advanced custom fields (3 posts)

  1. genieforge
    Member
    Posted 1 year ago #

    How do I include "Advanced Custom Fields" in the PDF creation?

    http://wordpress.org/plugins/post-pdf-export/

  2. genieforge
    Member
    Posted 1 year ago #

    I reckon I could figure it out if I could add PHP to the template loop?

  3. genieforge
    Member
    Posted 1 year ago #

    Bazzinga!!!!!!!

    It may not be the most elegant fix but I made a new shortcode for "Post PDF Export". I added the below to "post-pdf-export/post-pdf-export.php", which you can get to by clicking edit under "Post PDF Export" on the plugin page:

    <?php
    
    //[custom1]
    function custom1_func( $atts ){
    $custom1 = get_field('field_name');
    return $custom1;
    }
    add_shortcode( 'custom1', 'custom1_func' );
    ?>

    The "field_name" is the field name of the ACF field. Paste [custom1] into your template loop on "Post PDF Export" template manager in WordPress and ya done, ACF fields in a PDF!!!

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • Post PDF Export
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic

Tags

No tags yet.