feat: add keywords section to PDF download
Updated the PDF generation process to include article keywords in the downloaded document. Keywords are pulled from post metadata and are displayed in italics below the abstract. This enhances the document's SEO value and improves content discoverability.
This commit is contained in:
parent
81d567447b
commit
3c32d5eaf8
1 changed files with 8 additions and 0 deletions
|
@ -950,6 +950,14 @@ function handle_pdf_download()
|
|||
$pdf->writeHTML("<b>Abstract:</b> " . $post->post_excerpt);
|
||||
}
|
||||
|
||||
// Set keywords
|
||||
$keywords = get_post_meta($post_id, 'article_keywords', true);
|
||||
if (!empty($keywords)) {
|
||||
$pdf->Ln(10);
|
||||
$pdf->SetFont('helvetica', 'I', 12);
|
||||
$pdf->writeHTML('<b>Keywords:</b> ' . implode(', ', array_map('esc_html', $keywords)));
|
||||
}
|
||||
|
||||
// Set content
|
||||
$pdf->setTextColor(0);
|
||||
$pdf->Ln(10);
|
||||
|
|
Loading…
Reference in a new issue