I am manually inserting a write blog form into a page in buddypress: "../members/lyradmil/write". My form displays fine but hitting the submit button does not submit the form. No entries are recorded. The page simply "refreshes" and nothing else happens. I have also included: <?php gravity_form_enqueue_scripts(1, true); ?> in the "header.php" file but to no avail.
This is my code in "functions.php" to display the form:
// Write blog
bp_core_new_nav_item(
array(
'name' => __( 'Write Blog', 'buddypress' ),
'slug' => 'write',
'position' => 50,
'show_for_displayed_user' => false,
'screen_function' => 'write_blog',
'item_css_id' => 'bp_special_nav',
'default_subnav_slug' => 'write'
)
);
// Write blog (subnav)
bp_core_new_subnav_item(
array(
'name' => __( 'Write blog' ),
'slug' => 'write',
'parent_url' => $bp->loggedin_user->domain . $bp->slug,
'parent_slug' => 'write',
'screen_function' => 'write_blog',
'position' => 10,
'item_css_id' => 'bp_special_subnav'
)
);
/* Create write blog page */
function write_blog() {
//add title and content here – last is to call the members plugin.php template
add_action( 'bp_template_title', 'write_blog_title' );
add_action( 'bp_template_content', 'write_blog_content' );
bp_core_load_template( apply_filters( 'bp_core_template_plugin', 'members/single/plugins' ) );
}
/* Link title for Write blog page */
function write_blog_title() {
echo 'Start writing!';
}
/* Add content to the Invite page */
function write_blog_content() {
//add_filter( 'bp_get_activity_content_body', 'do_shortcode' );
echo do_shortcode('[gravityform id=1 title=false description=false ajax=true]');
//gravity_form(1, false, false, false, '', true);
}