• Hi I need two columns in the pdf, but i don´t know where is the location correct for apply the next code:
    [dkpdf-columns columns=”2″ equal-columns=”true” gap=”20″]
    [/dkpdf-columns]

    or where call to the function dk-pdf/includes/dkpdf-shortcodes.php, this is the code:

    function dkpdf_columns_shortcode( $atts, $content = null ) {

    $atts = shortcode_atts( array(
    ‘columns’ => ‘2’,
    ‘equal-columns’ => ‘true’,
    ‘gap’ => ’10’
    ), $atts );

    $pdf = get_query_var( ‘pdf’ );

    if( $pdf ) {
    $columns = sanitize_text_field( $atts[‘columns’] );
    $equal_columns = sanitize_text_field( $atts[‘equal-columns’] );
    $vAlign = $equal_columns == ‘true’ ? ‘vAlign=”justify”‘ : ”;
    $gap = sanitize_text_field( $atts[‘gap’] );
    return ‘<columns column-count=”‘.$columns.'” ‘.$vAlign.’ column-gap=”‘.$gap.'” />’.do_shortcode( $content ).'<columns column-count=”2″>’;
    } else {
    remove_shortcode( ‘dkpdf-columnbreak’ );
    add_shortcode( ‘dkpdf-columnbreak’, ‘__return_false’ );
    return do_shortcode( $content );
    }

    }
    add_shortcode( ‘dkpdf-columns’, ‘dkpdf_columns_shortcode’ );

    Thank you, greetings!

    The page I need help with: [log in to see the link]

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

The topic ‘How to apply the dkpdf_pagebreak_shortcode function ?’ is closed to new replies.