WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have this dilemma whereby I'd like FB-Connect or a similar tool to automatically push custom data found in Custom Post Types to Facebook. Here's an example (it only works because it's a manual workaround). The final result is/should be this:

Result with manual workaround

I can achieve that by placing this in the header:

if (is_singular('adoptions')) {
echo '<meta name="description" content="';
echo 'New Pet for Adoption! ' . $name . ' is a ' . $age . ' year old ' . $gender . ' ' . $breed . ' who needs a home!';
echo '" />';}

It's great because I can exactly influence the excerpt (but the downside is everything needs to be done manually). Not so with Custom Post Types and auto-publish where the empty content of the post type then only shows an image and '...', in other words giving the reader no clue what this is about.

What I'm thinking is that I can either:

  • Modify the automatic publisher from WP to push content in this manner (not even sure where to start), or.. and this seems easier;
  • Create a custom RSS feed which is then imported into the page via an RSS app? The added benefit is that the feed can be used elsewhere too.

What does the dream-team think? :)

Thank you!

share|improve this question
>"where the empty content of the post type" ... Why not just put something in the content? – Otto Feb 19 '11 at 22:30
Well it's used for the description of the pet, and that's only filled out 10-20% of the time, so I'm trying to think of the end-user here. It'd be much more professional if I can provide a structured post to the facebook page everytime. I found a couple RSS tools so I'm thinking this will probably be the best way. – Noel Tock Feb 19 '11 at 22:34
up vote 0 down vote accepted

If anyone else is interested, this is how I solved it:

I created a custom feed as a page template. As RSS 2.0 doesn't support images for each entry/item, I created an Atom feed instead; all that contains is the image and the text as I have it formatted in my question above. Then I use the facebook app RSS Graffiti to automatically import it, final result:

enter image description here

The benefit is that the feed can be used elsewhere too.

Alternate Solution:

If I wanted to use FB-Connect, I think a workaround could be done in the form of hiding the description from the post type, and then populating the description field. This way, image & text could still be passed through to FB.

share|improve this answer
Alternatively there is a little more proper way to generate additional feeds with add_feed() function. Unfortunately it is poorly documented, but more robust if you need to package code as plugin and not rely on templates in theme and creating pages manually. – Rarst Feb 20 '11 at 11:32
Hi Andrey, thank you for this. I actually found a 2 year old post by Otto on this earlier in the morning and have already implemented it. It definitely deserves it's own tutorial though, I'll see what I can put together in the coming days. – Noel Tock Feb 20 '11 at 15:29

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.