• Resolved mahrr

    (@maloherry)


    Hello,
    I’d like to add the post publication date in the footer of the PDF, is that something we can achieve ?

    Thanks!

    • This topic was modified 5 years, 4 months ago by mahrr.
Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter mahrr

    (@maloherry)

    Managed to do it in the header with :

    function changing_dkpdf_header_title( $title ) {
    	if ( have_posts() ) : while ( have_posts() ) : the_post();
    		$title .= ' by ' . get_the_author_meta( 'display_name' ) . ' on ' . get_the_time('d F Y') ;
    	endwhile; else:
    	endif;
    	return $title;
    }
    add_filter( 'dkpdf_header_title', 'changing_dkpdf_header_title' );
    Thread Starter mahrr

    (@maloherry)

    And in the footer by modifying dkpdf-footer.php :

      <div style="width:100%;float:left;padding-top:10px;">
    		    <div style="float:right;text-align:right;">
    
    				<?php
    					// check if Footer show title exists
    					if ( $pdf_footer_text ) {
    
    						echo $pdf_footer_text; 
    
    					} 
    
    				?>
    				on <?php the_time('d F Y'); ?>
    
    				<?php
    					// check if Footer show title is checked
    					if ( $pdf_footer_show_title ) {
    
    						echo get_the_title( $post->ID );
    
    					} 
    
    				?>
    
    				<?php
    					// check if Footer show pagination is checked
    					if ( $pdf_footer_show_pagination ) {
    
    						echo apply_filters( 'dkpdf_footer_pagination', '| {PAGENO}' );
    
    					} 
    
    				?>
    
    		    </div>
    	    </div>
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Add date in footer’ is closed to new replies.