Is there a plugin that can enable me to provide a .js file to my users so they can paste javascript into their pages to syndicate my RSS feed?
Is there a plugin that can enable me to provide a .js file to my users so they can paste javascript into their pages to syndicate my RSS feed?
Not that I've ever seen.
Feedburner will do it though, for what that's worth.
ah, thanks, I hope instead there is something that can do it on the blog-side so I don't need to use an outside service.
I have had some success with this trick. Create a PHP page (say, jsfeed.php) in the root directory of your WordPress blog. It will be, however, called as a Javascript page. Depending on what information you want, the PHP is used to create the content for Javascript. For example, a simple list of titles:
while (have_posts()) : the_post(); ?>
document.write("<a href='<?php the_permalink() ?>'><?php the_title(); ?></a>");
<?php endwhile; ?>
This is called on an HTML page with:
<script language="JavaScript" src="http://bloglocation/jsfeed.php" />Perfect! Thanks!
eric23,
I've used the code you provided, but I'm getting an error:
undefined function have_posts()
Can you tell me what whole jsfeed.php file should look like?
This would make a great plugin!
This topic has been closed to new replies.