try this one…
locate_template( array( '/wire/post-form.php' ), true );
It should put the form there
yeah i tried putting “include” code either. i can see the form with your code either but when i click the send button i get a 404 “Page Not Found” error. because it cannot render member slug or wire post link. i see the url like that: mysite.com/wire/post that’s the problem. the form’s action doesnt work… i think the problem is with that function: bp_wire_get_action()
any ideas?
and yeah, due to i’m using this code for the root of the site, it cannot apply filter for the root directory. solution must be here somewhere i guess:
bp_get_wire_get_action:
return apply_filters( 'bp_get_wire_get_action', site_url() . '/' . $bp->{$bp->active_components[$bp->current_component]}->slug . '/' . $uri . '/' . $bp->wire->slug . '/post/' );
hi
well I got your idea better now.You want something like twitter where a person writes to his her own wall.
In that case ,there are a few things you can do.
1.add filter to change the wp_wire_action
something like this
function my_bp_wire($wire)
{
global $bp;
if(is_home())
return get_bloginfo('wpurl');
else
return $wire;
}
add_filter("bp_get_wire_get_action","my_bp_wire");
2.Create your own handler for handling the wire post action.here your item of interest will be functions
bp_wire_new_post
also, you may like to take a look at bp-xprofile.php and the function xprofile_action_new_wire_post
to see how the wire posts at handled at profile page.You jaust have to digg a little deep and create a hacked version of the xprofile_action_new_wire_post,as your own function ,so if someone posts at the site’s home page,It is correctly saved as wire post.
Let me know ,How it goes with you.
thank you sir. i solved the problem by myself by defining a new function . but your first solution is shorter than mine so thank you again
edit: and there’s a problem with your 1st function. when i click it the form doesnt work.
i’ve created a new function like that:
function bp_my_custom_wire_post() {
echo my_custom_wire_post();
}
function my_custom_wire_post() {
global $bp;
if ( empty( $bp->current_item ) )
$uri = $bp->current_action;
else
$uri = $bp->current_item;
if ( $bp->current_component == $bp->wire->slug || $bp->current_component == $bp->profile->slug ) {
return apply_filters( 'my_custom_wire_post', $bp->loggedin_user->domain . $bp->wire->slug . '/post/' );
}
}
and i’ve created a new customized post-form.php for myself. i gave it “mywirepost.php” name. and then i put my locate code to my homepage:
locate_template( array( '/wire/mywirepost.php' ), true );
that’s all . i’ve solved my own problem and that’s way how you learn better . thank you brajesh for your help.. i appreciate your interest. regards.
Great post, this might help people looking to use p2 theme for wires.