Pergunta

One of my wordpress blog is protected by the wordpress password plugin. however, I would like provide rss features. I found how to configure wordpress plugin to make rss work. But, by default, it seems that all the content of a post is sent by the feed. I would like to limit the information available by rss. Ideally, I would like to provide only the title of a post by rss. I have pictures and video (by vimeo) that have not to be available by rss ! Any help ?

Thanks

Foi útil?

Solução 2

I have found two solutions :

1) First one, very easy, just select summary in the feed options of wordpress. Since this option is activated, neither pictures nor videos are displayed.

2)The second one is adding this piece of code in your theme's functions.php

add_filter('excerpt_length',create_function('$a','return 0;'));

ref : https://stackoverflow.com/questions/2815551/wordpress-how-to-limit-characters-to-show-at-feeds

With this solution, only the title of each post is available by rss ! Exactly what I want !

Outras dicas

I've wrestled with this problem myself. The issue is that many RSS readers don't support authentication, so even if you manage to protect your feed, the content won't be readble for many clients.

Using the WordPress Password plugin is probably the wrong way to go. Directly from the author's site:

I’ve pretty well ended support of this. I’m not intentionally avoiding emails or comments, I’m just out of time and need to make you aware there’s a better way.

I’d like to encourage you not to use the WP-Password Plugin. Here’s why: It doesn’t protect items in feeds, it can be broken by future wordpress versions, it doesn’t protect media/videos/images in your feeds (only pages powered by WP), and at last check, changing WP to do what I want the plugin to do really jeopardizes it’s security of all other things WP. I just don’t want to do that to you.

Instead, I recommend using .htaccess to protect the directories you want people to see. Here’s a good tutorial on it: http://www.javascriptkit.com/howto/htaccess3.shtml

So, there's your answer -- use .htaccess.

EDIT 1

Cats Who Code has some nice .htaccess tricks that are applicable to WordPress listed here. It doesn't cover password protection, but it could give you some further ammo.

EDIT 2

If you're trying to give the post titles but no content, why not simply use WordPress' built-in password protection mechanism? This should send the post titles but make the body of the RSS items read something like "The contents of this article are protected".

Licenciado em: CC-BY-SA com atribuição
Não afiliado a wordpress.stackexchange
scroll top