Forum Replies Created
-
I have solved this problem with a new paged param. I send my plugin if is useful for somebody.
The plugin first check if the user is author on any post. Then displays the post of the author on a new tab.
Best regards.
Hi @danbp
I think I have done the same configuration as you, but don’t work for me. Could be possible thar your code not work with the new version of Buddypress?
This are my posts:
This is that I see with
'posts_per_page' => 2,
:
Before, I have tested with Twenty Thirteen, Now I’m testing with Twenty Fifteen theme.
I have created a bp-custom.php file on plugins/ folder and deleted my previous plugin.
The only plugin I have active is Buddypress:
—
I would like to display only one tab with the posts of the displayed user, without subtabs. My goal is remove “My posts” and “My Comments”. I would like to display the posts inside the “Contributions” tabHi @danbp
I have added your code as plugin on my new test site. On this site have activated only 2 plugins: buddypress and your code.
This is what I see on the “My posts” tab (there is no navigation):
I would like to display only one tab with the posts of the displayed user, without subtabs.
Hi @danbp
I have made the modification but get same result: navigation missed and if I write the “/page/2” url have “Oops! That page can’t be found.” message
Best regards
Hi @shanebp
I have modified my plugin with
'parent_url' => $bp->displayed_user->domain, 'parent_slug' => $bp->profile->slug,
And remove the title of the tab.
But still I can’t get the pagination working
Hi @shanebp
Have same result with http://pastebin.com/tBcTSmMn
Hi @shanebp
Sorry. I have added the modifications. Now I can’t see any pagination links, and if I try go to /page/2 get same “page not found” message.
This is the code: http://pastebin.com/m2RzyJ4j
Hi @shanebp I have tested your code. I need remove the echo because gives an error.
This is the modified code, but have same error: http://pastebin.com/emdJv4F6
Thanks for your help
Thanks @Hugo for publish it.
There is a way so save posts like draft? I think I can’t do that.
Hi @Hugo Could I post it or I need wait to its approved?
Hi @djsteveb
I have added more than 2 links. I wait for the approbation of the post. It’s a shame that the rules are not more visible, and that there is no notification of the moderation.Thank you for your answer. Cheers!
Hi @danbp Do you know if exist any integration with jetpack embeds?
Best regards
Hi @henrywright,
I need increase from 150px to 250px. My goal is that facebook recognize as feature images to share.
Thank you and best regards
Hi @shanebp,
I can solve the problem!
This is the code thats work perfect:
add_filter( 'bp_blogs_record_activity_content', 'record_post_activity_content_update'); function record_post_activity_content_update( $excerpt, $post_content, $activity ) { global $post; if( $post->post_type == 'post' ) { $post_content= '<a href="' . get_permalink( $post->ID ) . '" class="activity-content-title" >' . get_the_post_thumbnail( $post->ID, 'articulo-lateral') . get_post_field('post_title', $post->ID) . '</a>' .get_post_field('post_content', $post->ID); } return $post_content; }
Example:
1- New post activity: https://i.imgur.com/75Qf5WH.png
2- Edited post activity: https://i.imgur.com/0dWME4m.pngThe only problem that I find is not caused by this: Activity comments closed for the edited posts: https://buddypress.org/support/topic/activity-comments-closed-for-the-edited-posts/
Thanks and best regards,
GabrielHi @shanebp,
Thanks for your help. I have tried many hours and “record_post_activity_content_update” make me crazy.The code I use is this:
add_filter( 'bp_blogs_record_activity_content', 'record_post_activity_content_update'); function record_post_activity_content_update($content){ return '<a href="' . get_permalink( $post->ID ) . '" class="activity-content-title" >' . get_the_post_thumbnail( $post->ID, 'articulo-lateral') . get_post_field('post_title', $post->ID) . '</a>' . get_post_field('post_content', $post->ID); }
With this code:
1. if I create a new post, the activity shows the image, title, but not the post content.
2. If I update the post, the activity shows all, but old content (not updated)I have made a video with the problem: I hope you can help me: http://screencast-o-matic.com/watch/c26IYneixI
Best regards,
GabrielDid anyone have this problem?
BUMP
I have same problemjust call bp_loggedin_user_avatar fuction, it print html code of the avatar (without echo)
bp_loggedin_user_avatar( ‘type=full&width=150&height=150′ );
Hi @meg@info,
This only works in activity or profile page. In wordpress pages not load the avatar.
Greetings
I know the problem: is the WPUF plugin. Now, the developer send me the solution:
function wpufe_modify_bp_activity( $post_id ) { global $wpdb, $user_ID; //get the last inserted activity $activity = $wpdb->get_row( "SELECT * FROM {$wpdb->prefix}bp_activity WHERE secondary_item_id = $post_id AND user_id = $user_ID"); // if activity found, update the activity with custom field if ( $activity ) { $content = $activity->content . '... Custom Field: ' . get_post_meta( $post_id, 'custom_field', true ); $wpdb->update( $wpdb->prefix . 'bp_activity', array( 'content' => $content ), array( 'id' => $activity->id ) ); } } add_action( 'wpuf_add_post_after_insert', 'wpufe_modify_bp_activity' );
http://wedevs.com/support/topic/custom-fields-in-budypress-activity-content/#post-5889
Greetings
I think the problem is that i can’t get the post id. I tried with this code and it works:
return get_post_meta(577, 'txt_link', true).'This1';
I tried in many ways but I cant get the post-id to work with bp_blogs_activity_new_post_content filter
Hi, I simplify the code and get same result: the text “this yes” appears, and the custom-field not.
add_filter( 'bp_blogs_activity_new_post_content', 'record_post_activity_content' ); function record_post_activity_content(){ return get_post_meta($post->ID, 'txt_link', true).'this yes'; }
With this code I have NO results:
function test1(){ global $post; $test_customfield = get_post_meta($post->ID, 'txt_documento', true); return $test_customfield; } //function test1( $the_post ) { // $post_id = $the_post->ID; //} function record_post_activity_content($activity_content, $post, $post_permalink ){ if( $post->post_type == 'post' ) { $not = var_dump( $test_customfield ); $activity_content = $not.'this yes'; } return $activity_content; } add_filter( 'bp_blogs_activity_new_post_content', 'record_post_activity_content',1, 3 );
But I’ve tested this another code and the result is “NULL”:
add_action( 'genesis_post_content', 'custom_field_in_content' ); function custom_field_in_content() { if ( in_category('documentos') ) { $ay = var_dump( $test_customfield ); echo $ay; }else { } }
I cant find the problem. Thanks for all your support
@boonebgorges YES it works!!!
But when I tried to show a custom-field stops working. This is my example code:
function test1(){ global $post; $test_customfield = get_post_meta($post->ID, 'txt_documento', true); return $test_customfield; } function record_post_activity_content($activity_content, $post, $post_permalink ){ if( $post->post_type == 'post' ) { $not = test1(); $activity_content = $not.'this yes'; } return $activity_content; } add_filter( 'bp_blogs_activity_new_post_content', 'record_post_activity_content',1, 3 );
Thanks!
@frequeunce, I think that have one comment thread for post and another comment thread for activity is confusing for users. I would hope that another buddypress user can solve this.
Greetings
BUMP