Viewing 3 replies - 1 through 3 (of 3 total)
  • Moderator bcworkz

    (@bcworkz)

    “RSS Atom feed” does not make sense. RSS and Atom are two different web feed formats. Do you want Atom or RSS format? I’ll assume you want Atom and you are simply adding a link to a PDF file and not trying to encode it inline with the feed.

    It’s simply an atom:link element with the appropriate attributes. The example in the above link needs to be translated to XML format. For example:

    <?xml version="1.0" encoding="utf-8"?>
    <feed xmlns="https://www.w3.org/2005/Atom">
    ...
    <entry>
         ...
         <link rel="enclosure" 
                  href="https://www.foo.com/bar.pdf" 
                  length="12216320" 
                  type="application/pdf"
                  hreflang="en" />
         <link rel="enclosure" ..... />
    ...
    Thread Starter yard

    (@yard)

    Hi bcworkz

    thank you for reply. Sorry for no exact terms. I need this for partners website which agregate my feed and displaying it

    The wish have “Atom” feed with exact content and enclosured info′s

    My feed is
    https://www.kremnica.sk/category/oznamy/feed/atom
    and pdf′s are not linked as rel=”enclosure”

    other rss readers can obtain pdf links from my feed correctly, but partner website no, because they need have <link rel=”enclosure” type=”application/pdf” in feed :

    https://i.imgur.com/glw5uoZ.png

    https://i.imgur.com/vI7Pxyv.png

    for that I need customise ATOM feed for inserting <link rel=”enclosure” type=”application/pdf” correctly

    Moderator bcworkz

    (@bcworkz)

    Yes, you must customise. See Customizing Feeds. You can base your custom template on wp-includes/feed-atom.php, renaming it of course. Place your file with the theme templates.

    To protect your file from being deleted during theme updates, create a child theme or plugin to contain the template. Any other custom work can go in the same place. If you use a plugin, get_template_part() in the example only works for theme templates. Use load_template() or require() for templates in a plugin folder.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘How enhance RSS to enclosure attachements informations’ is closed to new replies.