Attachments

In all press releases sent out from MFN we provide an attachment section in the text body.

However, this is not the case for stories sent from other newswires such as for example Cision or Globe. To enable attachments for all releases, you can choose to manually list the attachments underneath each single news item.

We include attachment data for each imported news item and this data is available in in the wp_postmeta table.

The information is stored in the following two keys:

mfn_news_attachment_link (Contains the a href link to the attachment)

<a href='https://url_to_attachment.pdf' content='application/pdf' target='_blank' rel='noopener'>Release</a>

mfn_news_attachment_data (Contains further information about the attachment such as the content-type)

{"file_title":"Release","content_type":"application/pdf","url":"https://url_to_attachment.pdf","tags":[":primary"]}

To list attachments on MFN news, first duplicate your single.php-file in you theme to single-mfn_news.php and then edit it to add the following lines of code:

foreach (get_post_meta(get_the_ID(), 'mfn_news_attachment_link' ) as $link)
{
    echo $link;
}

However if you do this you must not forget to hide the attachment footer for MFN-releases, by adding this line of CSS: .mfn-attachment { display: none; }

Last updated