Skip to:
Content
Pages
Categories
Search
Top
Bottom

How to get post images in Activity if theme post has custom fields for images?

  • Avatar of Nm
    nm
    Participant

    @nahummadrid

    Alot of themes use custom fields to include images for a post and different post types. These do not get pulled into the activity content like an image inserted into a post.

    How can i get activity to pass over custom fields for images first then default to images inserted/attached to post.

    Any ideas

Viewing 13 replies - 1 through 13 (of 13 total)
  • Avatar of Nm
    nm
    Participant

    @nahummadrid

    Still not able to find a way to do this, I’ve only come across this thread from a while back.

    http://buddypress.org/forums/topic/displaying-custom-fields-in-home-widgets

    My theme uses custom fields to set an image in a post. I don’t insert it in the post editor. So these images don’t get pulled into the activity like they would if they were inserted.

    <?php echo get_post_meta( $post->ID,”custom-field-name”, $single=true ) ; ?>

    Avatar of Nm
    nm
    Participant

    @nahummadrid

    Anyone have an idea how to get activity to look for custom field images to display in stream not only images inserted in the post.

    Avatar of EBOC
    EBOC
    Participant

    @naijaruns84

    Same problem. I’ve tried using a plugin that lets you add custom fields to your rss feed. (http://justintadlock.com/archives/2008/01/27/custom-fields-for-feeds-wordpress-plugin) but just doesn’t work, like buddypress adjusted the default wordpress feed generator. Has anyone else had this problem or know how to fix?

    Avatar of Anointed
    Anointed
    Participant

    @anointed

    I have been working with Brajesh on this same problem for quite some time now. So far it’s not working.

    Here is what we do know:

    [blockquote]
    It seems to me , the problem is with the order when the custom field is saved and the post is published. If post is published before saving custom field(which happens because of auto revision mode turned on in wp), we will never be able to get the custom field data on save_post action. I am looking for some other action to hook it.
    [/blockquote]

    We have also tried turning off post revisions, but that made no difference.

    It would be really nice to hear from ‘those that know’ what the problem may be. So far we have had no problem creating new modules in order to populate the activity stream with new custom post-types. However the stupid problem with custom fields not showing up is still present.

    any dev’s care to chime in on this one?

    Avatar of EBOC
    EBOC
    Participant

    @naijaruns84

    Is there anyone that can help?

    Avatar of Anointed
    Anointed
    Participant

    @anointed

    Would any of the dev’s please chime in on this one?
    I’ve gone through most of the code for the past few days, and still cannot find an action to hook into that will allow me to add any custom field to the activity stream.

    I do have a new component that allows me to add a custom post-type to the activity stream, but the custom fields issue still persists.

    Avatar of r-a-y
    r-a-y
    Moderator

    @r-a-y

    Look at the bp_blogs_record_post() function in bp-blogs.php.

    Are you sure it isn’t possible to hook into the “bp_blogs_activity_new_post_content” filter?
    Using the $post variable, I’m pretty sure you can grab the $post->ID. From there, you should be able to use the get_post_meta() function and grab the custom field.

    Append and return your extra custom field content to the “bp_blogs_activity_new_post_content” filter and it should work.

    Though if Brajesh says he’s having trouble, then there’s probably another issue at work here.

    If you’re using WPMU, then you’d need to use switch_to_blog() to grab the postmeta… which is quite intensive…

    Avatar of Anointed
    Anointed
    Participant

    @anointed

    @r-a-y

    Per Brajesh:
    [blockquote]
    It seems to me , the problem is with the order when the custom field is saved and the post is published. If post is published before saving custom field(which happens because of auto revision mode turned on in wp), we will never be able to get the custom field data on save_post action. I am looking for some other action to hook it.
    [/blockquote]

    This issue persists even after turning off auto-revision.

    Avatar of r-a-y
    r-a-y
    Moderator

    @r-a-y

    Read this for a possible solution:

    http://wordpress.org/support/topic/344937

    Avatar of Anointed
    Anointed
    Participant

    @anointed

    Thanks ray, however we are already using the save_post action.

    Have you or any of the other bp dev’s even attempted to show a custom field in the activity stream for either a blog post, or other data type(post-types)?

    Avatar of Nm
    nm
    Participant

    @nahummadrid

    wow didn’t know any of this was happening on this post but it looks like progress…will look into the updated feedback very soon as I seem to only use custom fields in posts nowadays. thanks all. btw what is the best way to subscribe to my own forum topics activity, sheesh…

    Avatar of Nm
    nm
    Participant

    @nahummadrid

    @anointed any progress here…any ideas on how to make use of post types, custom fields, etc.

    Avatar of Tony Locke
    Tony Locke
    Participant

    @tonylocke

    I want to use this http://www.weather.com/weather/today/30075
    and replace it with
    http://www.weather.com/weather/today/%zipcode% from the zipcode field of my users profiles. But, I can’t get it to work. I want the weather to show up in a bottom widget area unique to the users zipcode field from their profile.

    Anyone know how I can do this?

    I think it is failing to pull the user’s zipcode field setting because the RSS feed is from weather.com and not my domain.

    Any ideas?

Viewing 13 replies - 1 through 13 (of 13 total)

You must be logged in to reply to this topic.