Custom feed of Video Category link back to post?
-
The Problem
When users subscribe by email, embedded videos do not appear in the email. The subscriber doesn’t know a video has been posted unless stated in the title or text of the post.The Solution
Automatically include a “Click Here to view the Video” link in the feed on all posts in the “Video” category. Even though email subscribers still won’t see the video in their email, they will know a video has been posted because of the link at the bottom of the posts.I’ve added the following code to my theme’s function file, however, the template tags used for the permalink and title do not work at all. I can’t figure out how to make this function output the correct link back to the post. Any suggestions?
add_filter('the_content','video_feed'); function video_feed($content) { if ( is_feed() && in_category('Video') ) { $content = $content . '<p><a href="<?php the_permalink(); ?>" title="View the Video for <?php the_title(); ?>">Click Here</a> to view the video.</p>' ; } return $content; }
Here’s a live version of the above code:
- The topic ‘Custom feed of Video Category link back to post?’ is closed to new replies.