How to Insert Variables Into WordPress PHP Feed Codes

Visitors to your WordPress blog can subscribe to future posts via feeds, templates for which are built in to WordPress by default. WordPress has templates for multiple feed protocols, including RSS and Atom. These templates include information such as your blog title, description and language, all populated with PHP variables from your main WordPress installation. You can modify these values by inserting new variables into the source code.

Instructions

    • 1

      Launch an FTP client such as Fetch, FireFTP or FileZilla and connect to your WordPress blog.

    • 2

      Open the "wp-includes" directory inside your blog directory. This directory contains all of the feed templates including "feed-rss2.php" for RSS 2.0, "feed-rss.php" for RSS 0.92, "feed-rdf.php" for RSS 1.0/RDF and "feed-atom.php" for Atom.

    • 3

      Open the template you want to edit in a text editing program such as e, Notepad or TextEdit. Your FTP client may have an editing client built-in.

    • 4

      Replace existing PHP variables or insert new PHP variables in the template code. A variable in PHP looks like this: "<?php bloginfo_rss('url') ?>." Access a complete list of possible variables in the WordPress Codex Function Reference.

Tips & Warnings

  • If you automatically upgrade WordPress in the future it may override your modified feed templates. Backup your changes so you can re-apply them in the future or be sure to manually update WordPress, skipping over updating the feed files.

Related Searches:

References

Resources

Comments

Related Ads

Featured