How to use Prologue’s post-from-index-form with other themes
-
Hi there,
I was wondering if the posting-box from prologue (see https://www.ads-software.com/extend/themes/prologue) in other themes as well!
I tried copying the following part from prologue’s index.php into k2’s index.php
<?php if( 'POST' == $_SERVER['REQUEST_METHOD'] && !empty( $_POST['action'] ) && $_POST['action'] == 'post' ) { if ( ! is_user_logged_in() ) auth_redirect(); if( !current_user_can( 'publish_posts' ) ) { wp_redirect( get_bloginfo( 'url' ) . '/' ); exit; } check_admin_referer( 'new-post' ); $user_id = $current_user->user_id; $post_content = $_POST['posttext']; $tags = $_POST['tags']; $char_limit = 40; $post_title = strip_tags( $post_content ); if( strlen( $post_title ) > $char_limit ) { $post_title = substr( $post_title, 0, $char_limit ) . ' ... '; } $post_id = wp_insert_post( array( 'post_author' => $user_id, 'post_title' => $post_title, 'post_content' => $post_content, 'tags_input' => $tags, 'post_status' => 'publish' ) ); wp_redirect( get_bloginfo( 'url' ) . '/' ); exit; } get_header( ); if( current_user_can( 'publish_posts' ) ) { require_once dirname( __FILE__ ) . '/post-form.php'; } ?>
and adding the post-form.php to the k2-dir, the form shows up now but if I try to post it redirects me to the admin-login instead of posting (yes, I’m logged in).
Am I missing something?
I think this could be very usefull for users who wants to use a different theme but don’t want to hassle with the dashboard at all!
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘How to use Prologue’s post-from-index-form with other themes’ is closed to new replies.