Ok, I have installed a theme. It has a page called: post-new.php and it opens using the following conical URL structure: digitalxfiles.com/post-new/ When you open it. You can see a form. My question is, Is that a Rewrite method? what method it is? Here is my .httaccess file: # BEGIN WordPress <IfModule mod_rewrite.c> RewriteEngine On RewriteBase / RewriteRule ^index\.php$ - [L] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule . /index.php [L] </IfModule> # END WordPress Code (markup): Now here is my problem: I created a new page called: post-new-form.php I copied all the code from post-new.php and added it to post-new-form.php Now I want to see the form in the new page I created How can I do that? I already tried digitalxfiles.com/post-new-form.php digitalxfiles.com/post-new-form/ So how can I make that work? Here is the post-new-form.php code: <?php /* if(!is_user_logged_in()) { wp_redirect(home_url()."/wp-login.php"); exit; } */ session_start(); $post = get_post($pid); $admin_email = get_bloginfo('admin_email'); global $wp_query, $current_user; get_currentuserinfo(); $new_ad_step = $wp_query->query_vars['step']; //================================================== global $current_user; get_currentuserinfo(); $uid = $current_user->ID; $new_pid = sangvish_get_auto_draft($uid); if($new_pid == false) { $new_pid = sangvish_create_auto_draft($uid); } $pid = $new_pid; //================================================== //---------------------------------- if(isset($_POST['post_submit'])) { $MarketItem_title = trim(htmlspecialchars($_POST['MarketItem_title'])); $MarketItem_description = nl2br(strip_tags(htmlspecialchars($_POST['MarketItem_description']))); $MarketItem_tags = trim(htmlspecialchars($_POST['MarketItem_tags'])); $MarketItem_cost = trim(htmlspecialchars($_POST['MarketItem_cost'])); $image1 = trim(htmlspecialchars($_POST['image1'])); $image2 = trim(htmlspecialchars($_POST['image2'])); $image4 = trim(htmlspecialchars($_POST['image4'])); $image5 = trim(htmlspecialchars($_POST['image5'])); $download_file = trim(htmlspecialchars($_POST['download_file'])); //------------------------------- $adOK = 1; if(empty($MarketItem_title)) { $adOK = 0; $error['title'] = __('You cannot leave the MarketItem title blank!','sangvish'); } if(empty($MarketItem_description)) { $adOK = 0; $error['description'] = __('You cannot leave the MarketItem description blank!','sangvish'); } if(empty($MarketItem_cost)) { $adOK = 0; $error['MarketItem_cost'] = __('Please suggest some price for your item.','sangvish'); } elseif(!is_numeric($MarketItem_cost) || $MarketItem_cost < 0) { $adOK = 0; $error['MarketItem_cost2'] = __('Price must be a number > 0','sangvish'); } if(empty($image1)) { $adOK = 0; $error['Image'] = __('Upload Small image for the item!','sangvish'); } if(empty($image2)) { $adOK = 0; $error['Large_image'] = __('Upload Large image for the item!','sangvish'); } // if(empty($download_file)) { $adOK = 0; $error['download_file'] = __('Upload zip file for the item!','sangvish'); } //------------------------------- $my_post = array(); $my_post['post_title'] = $MarketItem_title; $my_post['ID'] = $pid; $my_post['post_content'] = $MarketItem_description; wp_update_post( $my_post ); wp_set_post_tags( $pid, $MarketItem_tags); //------------------------------------ wp_set_post_terms wp_set_post_terms($pid,array($_POST['main_cat'],$_POST['sub_cat']),'item-cat',true); $_SESSION['post_new_MarketItem_id'] = $pid; $_SESSION['posted_thing_cat'] = $MarketItem_category2; $_SESSION['posted_thing_title'] = $MarketItem_title; $_SESSION['posted_thing_author'] = $current_user->ID; if($adOK == 1) //if everything ok, go to next step { $my_post = array(); $my_post['post_status'] = 'draft'; $my_post['ID'] = $pid; wp_update_post( $my_post ); $post = get_post($pid); $author = get_userdata($post->post_author); $user_email = $author->user_email; // send email to the admin if(get_option("wpf_admin_approves") == "Yes"): $message = sprintf(__('A new MarketItem was posted on your website. Don`t forget you need to approve it before it goes live.<br/> <a href="%s">Click here to approve it</a>.', 'sangvish'), get_bloginfo('siteurl'). "/wp-admin/edit.php?post_type=MarketItem"); sangvish_send_email($admin_email, sprintf(__('New MarketItem Posted - %s', 'sangvish'), $post->post_title), $message, 'html', get_bloginfo('name'), $admin_email); else: $message = sprintf(__('A new MarketItem was posted on your website.<br/> <a href="%s">Click here to view it</a>.', 'sangvish'), get_permalink($pid) ); sangvish_send_email($admin_email, sprintf(__('New MarketItem Posted - %s', 'sangvish'), $post->post_title), $message, 'html', get_bloginfo('name'), $admin_email); endif; if(get_option("wpf_admin_approves") == "Yes"): //send email to the user $message = sprintf(__('Your MarketItem (%s) has been posted on the website. However it is not live yet. The MarketItem needs to be approved by the admin before it goes live. You will be notified by email.<br/> After is approved the MarketItem will appear here: <a href="%s">%s</a>', 'sangvish'), $post->post_title, get_permalink($post->ID), $post->post_title ); sangvish_send_email($user_email, sprintf(__('Your new MarketItem has been posted - %s', 'sangvish'), $post->post_title), $message, 'html', get_bloginfo('name'), $admin_email); if ($image1) { update_post_meta($pid, 'sangvish_Image1', $image1); } if ($image2) { update_post_meta($pid, 'sangvish_Image2', $image2); } if ($image4) { update_post_meta($pid, 'sangvish_Image4', $image4); } if ($image5) { update_post_meta($pid, 'sangvish_Image5', $image5); } if ($download_file) { update_post_meta($pid, 'sangvish_download-file', $download_file); } update_post_meta($pid, "sangvish_documentation", $_POST['documentation']); update_post_meta($pid, "sangvish_browser", $_POST['browser']); update_post_meta($pid, "sangvish_layout", $_POST['layout']); update_post_meta($pid, "sangvish_files_inc", $_POST['files_inc']); update_post_meta($pid, "sangvish_price", $MarketItem_cost); update_post_meta($pid, "sangvish_sales", "0"); update_post_meta($pid, "sangvish_demo", $_POST['demo']); else: //send email to the user $message = sprintf(__('Your MarketItem (%s) has been posted on the website.<br/> See the MarketItem here: <a href="%s">%s</a>', 'sangvish'), $post->post_title, get_permalink($post->ID), $post->post_title ); sangvish_send_email($user_email, sprintf(__('Your new MarketItem has been posted - %s', 'sangvish'), $post->post_title), $message, 'html', get_bloginfo('name'), $admin_email); //------- wp_publish_post($pid); $my_post['post_status'] = 'publish'; $my_post['ID'] = $pid; wp_update_post( $my_post ); //------- endif; wp_redirect("http://www.resellergo.com"); //get_bloginfo('siteurl')."/my-account/post-published exit; } } //-------------- get_header(); ?> <script type="text/javascript" src="<?php echo UPLOAD; ?>/js/ajaxupload.3.5.js" ></script> <link rel="stylesheet" type="text/css" href="<?php echo UPLOAD; ?>/styles.css" /> <script type="text/javascript" > $(function(){ var btnUpload=$('#upload1'); var status=$('#status1'); new AjaxUpload(btnUpload, { action: '<?php echo UPLOAD; ?>/upload-image1.php', name: 'image1', onSubmit: function(file, ext){ if (! (ext && /^(jpg|png|jpeg|gif)$/.test(ext))){ // extension is not allowed status.text('Only JPG, PNG or GIF files are allowed'); return false; } status.text('Uploading...'); }, onComplete: function(file, response){ //On completion clear the status status.text(''); //Add uploaded file to list if(response !="error"){ $('<li></li>').appendTo('#files1').html('<img src="<?php echo UPLOAD; ?>/uploads/image/small_image/'+response+'" alt="" /><br /> <input type="text" name="image1" value="<?php echo UPLOAD; ?>/uploads/image/small_image/'+response+'" id="some_name">').addClass('success'); }else if(response==="size_error"){ $('<li></li>').appendTo('#files1').text('Please upload correct image dimention : width=80px,height=80px ').addClass('error'); } else{ $('<li></li>').appendTo('#files1').text(file).addClass('error'); } } }); var btnUpload=$('#upload2'); var status=$('#status2'); new AjaxUpload(btnUpload, { action: '<?php echo UPLOAD; ?>/upload-image2.php', name: 'image2', onSubmit: function(file, ext){ if (! (ext && /^(jpg|png|jpeg|gif)$/.test(ext))){ // extension is not allowed status.text('Only JPG, PNG or GIF files are allowed'); return false; } status.text('Uploading...'); }, onComplete: function(file, response){ //On completion clear the status status.text(''); //Add uploaded file to list if(response !="error"){ $('<li></li>').appendTo('#files2').html('<img src="<?php echo UPLOAD; ?>/uploads/image/large_image/'+response+'" alt="" /><br /> <input type="text" name="image2" value="<?php echo UPLOAD; ?>/uploads/image/large_image/'+response+'" id="some_name">').addClass('success'); }else if(response==="size_error"){ $('<li></li>').appendTo('#files2').text('Please upload correct image dimention : width=640px,height=358px ').addClass('error'); } else{ $('<li></li>').appendTo('#files2').text(file).addClass('error'); } } }); var btnUpload=$('#upload4'); var status=$('#status4'); new AjaxUpload(btnUpload, { action: '<?php echo UPLOAD; ?>/upload-image4.php', name: 'image4', onSubmit: function(file, ext){ if (! (ext && /^(jpg|png|jpeg|gif)$/.test(ext))){ // extension is not allowed status.text('Only JPG, PNG or GIF files are allowed'); return false; } status.text('Uploading...'); }, onComplete: function(file, response){ //On completion clear the status status.text(''); //Add uploaded file to list if(response !="error"){ $('<li></li>').appendTo('#files4').html('<img src="<?php echo UPLOAD; ?>/uploads/image/large_image/'+response+'" alt="" /><br /> <input type="text" name="image4" value="<?php echo UPLOAD; ?>/uploads/image/large_image/'+response+'" id="some_name">').addClass('success'); }else if(response==="size_error"){ $('<li></li>').appendTo('#files4').text('Please upload correct image dimention : width=640px,height=358px ').addClass('error'); } else{ $('<li></li>').appendTo('#files4').text(file).addClass('error'); } } }); var btnUpload=$('#upload5'); var status=$('#status5'); new AjaxUpload(btnUpload, { action: '<?php echo UPLOAD; ?>/upload-image5.php', name: 'image5', onSubmit: function(file, ext){ if (! (ext && /^(jpg|png|jpeg|gif)$/.test(ext))){ // extension is not allowed status.text('Only JPG, PNG or GIF files are allowed'); return false; } status.text('Uploading...'); }, onComplete: function(file, response){ //On completion clear the status status.text(''); //Add uploaded file to list if(response !="error"){ $('<li></li>').appendTo('#files5').html('<img src="<?php echo UPLOAD; ?>/uploads/image/large_image/'+response+'" alt="" /><br /> <input type="text" name="image5" value="<?php echo UPLOAD; ?>/uploads/image/large_image/'+response+'" id="some_name">').addClass('success'); }else if(response==="size_error"){ $('<li></li>').appendTo('#files5').text('Please upload correct image dimention : width=640px,height=358px ').addClass('error'); } else{ $('<li></li>').appendTo('#files5').text(file).addClass('error'); } } }); var btnUpload=$('#upload3'); var status=$('#status3'); new AjaxUpload(btnUpload, { action: '<?php echo UPLOAD; ?>/upload-file.php', name: 'uploadfile', onSubmit: function(file, ext){ if (! (ext && /^(zip)$/.test(ext))){ // extension is not allowed status.html('<div class="error">Only zip files are allowed</div>'); return false; } status.text('Uploading...'); }, onComplete: function(file, response){ //On completion clear the status status.text(''); //Add uploaded file to list if(response !="error" && response !="size_error" ){ $('<li></li>').appendTo('#files3').html('<img src="<?php bloginfo('template_url'); ?>/images/icon_zipbox_128.png" alt="" /><br /> <input type="text" name="download_file" value="<?php echo UPLOAD; ?>/uploads/file/'+response+'" id="some_name">').addClass('success'); }else if(response==="size_error"){ $('<li></li>').appendTo('#files3').text('Maximum upload file size is limited to 10 mb. Please upload lower than this. ').addClass('error'); } else{ $('<li></li>').appendTo('#files3').text(file).addClass('error'); } } }); }); setTimeout(function() { $('#main_cat').change(function(){ var $mainCat=$('#main_cat').val(); // call ajax $("#sub_cat").empty(); $.ajax({ url:"<?php bloginfo('wpurl'); ?>/wp-admin/admin-ajax.php", type:'POST', data:'action=my_special_action&main_catid=' + $mainCat, success:function(results) { // alert(results); $("#sub_cat").removeAttr("disabled"); $("#sub_cat").append(results); } }); } ); }, 1500); </script> <div class="page-info"> <div class="main-container"> <div id="breadcrumbs"> <?php dimox_breadcrumbs(); ?> </div> <h1 class="page-title" itemprop="name">Post New Item </h1> </div> </div> <div id='main_wrapper'> <div id="wrapper"> <div class="preview-item"> <?php if($new_ad_step == "1") { //----------------- $post = get_post($pid); $cat = wp_get_object_terms($pid, 'item-cat'); global $current_user; get_currentuserinfo(); $cid = $current_user->ID; if(is_array($error)) if($adOK == 0) { echo '<div class="errrs"><h2>Sorry, you missed to fill the following fileds</h2>'; foreach($error as $e) echo '<div class="newad_error">'.$e. '</div>'; echo '</div>'; } ?> <div class="post-new-form"> <?php if (get_option('wpf_auth_can_sub') == 'Yes' ): ?> <form method="post" enctype="multipart/form-data" action="<?php echo post_new_link();?>/step/1/?when_posting=1"> <fieldset> <label for=MarketItem_title><?php echo __('Title', 'sangvish'); ?>:</label> <p><input type="text" size="60" class="do_input" name="MarketItem_title" /> <span class="large_font"> </fieldset> <fieldset> <label for=download-file><?php echo __('Category','sangvish'); ?>:</label> <p><?php $cat = wp_get_post_terms( $pid, 'item-cat'); wp_dropdown_categories('show_count=0&selected=-1&hierarchical=1&depth=2&taxonomy=item-cat&hide_empty=0&exclude=1&show_option_none=Main Categories&name=main_cat&selected='.$cat[0]->term_id);?> <select name="sub_cat" id="sub_cat" disabled="disabled"></select> </p> </fieldset> <fieldset> <label for=MarketItem_description><?php echo __('Description', 'sangvish'); ?>:</label> <p> <?php wp_editor( $post->post_content, 'new-post-desc', array('textarea_name' => 'MarketItem_description', 'teeny' => false, 'textarea_rows' => 8,'media_buttons'=>FALSE) ); ?></br><br/> <?php __('Be decriptive and write about your product.', 'sangvish')?></p> </fieldset> <fieldset> <label for=MarketItem_tags><?php echo __('Tags', 'sangvish'); ?>:</label> <p><input type="text" size="50" class="do_input" name="MarketItem_tags" value="<?php echo $MarketItem_tags; ?>" /> </p> </fieldset> <fieldset> <label for=MarketItem_cost><?php echo __('Icon', 'sangvish'); ?>:</label> <div id="upload1"><span>Upload File<span></div> <span id="status1" ></span> <ul id="files1" ></ul> </br><p><?php echo __('Recommended Image size 80 X 80 px.', 'sangvish'); ?> </p> </fieldset> <fieldset> <label for=MarketItem_cost><?php echo __('Image 1', 'sangvish'); ?>:</label> <div id="upload2"><span>Upload File<span></div><span id="status2" ></span> <ul id="files2" ></ul> </br><p><?php echo __('Recommended Image size 640 X 350 px.', 'sangvish'); ?> </p> </fieldset> <fieldset> <label for=MarketItem_cost><?php echo __('Image 2', 'sangvish'); ?>:</label> <div id="upload4"><span>Upload File<span></div><span id="status4" ></span> <ul id="files4" ></ul> </fieldset> <fieldset> <label for=MarketItem_cost><?php echo __('Image 3', 'sangvish'); ?>:</label> <div id="upload5"><span>Upload File<span></div><span id="status5" ></span> <ul id="files5" ></ul> </fieldset> <fieldset> <fieldset> <label for=MarketItem_cost><?php echo __('Product Url', 'sangvish'); ?>:</label> <p><input type="text" size="50" name="demo" value="<?php echo get_post_meta( $pid, 'sangvish_download-file', true ); ?>" /> <?php echo __('(Use http://www.)', 'sangvish'); ?> </p> </fieldset> <?php /* <fieldset> <label for=MarketItem_cost><?php echo __('Download file', 'sangvish'); ?>:</label> <div id="upload3"><span>Upload File<span></div><span id="status3" ></span> <ul id="files3" ></ul> <p></br><?php echo __('File size should not be more than 10 mb.', 'sangvish'); ?></p> </fieldset> <fieldset> <label for=MarketItem_cost><?php echo __('Compatible Browsers', 'sangvish'); ?>:</label> <p><input type="text" size="50" name="browser" value="<?php echo get_post_meta( $pid, 'sangvish_browser', true ); ?>" /> </p> </fieldset> <fieldset> <label for=country><?php echo __('Documentation','sangvish'); ?>:</label> <p> <select name="documentation"> <?php $Documentation= array("Well Documentation","No Documentation" ); foreach ( $Documentation as $docu) { ?> <option <?php if (get_post_meta( $pid, 'sangvish_documentation', true ) == $docu) { echo 'selected="selected"'; } ?>><?php echo $docu; ?></option> <?php } ?> </select> </p> </fieldset> <fieldset> <label for=country><?php echo __('Layout','sangvish'); ?>:</label> <p> <select name="layout"> <?php $layouts= array("Boxed","Responsive","Fullwidth"); foreach ( $layouts as $layout) { ?> <option <?php if (get_post_meta( $pid, 'sangvish_layout', true ) == $layout) { echo 'selected="selected"'; } ?>><?php echo $layout; ?></option> <?php } ?> </select> </p> </fieldset> <fieldset> <label for=MarketItem_cost><?php echo __('Included Files', 'sangvish'); ?>:</label> <p><input type="text" size="50" class="do_input" name="files_inc" value="<?php echo get_post_meta( $pid, 'sangvish_files_inc', true ); ?>" /> </fieldset> */ ?> <fieldset> <label for=MarketItem_cost><?php echo __('Selling Price', 'sangvish'); ?>:</label> <p><input type="text" size="50" class="do_input" name="MarketItem_cost" value="<?php echo $MarketItem_cost; ?>" /> </p> </fieldset> <fieldset> <label for=MarketItem_cost><?php echo __('Demo Url', 'sangvish'); ?>:</label> <p><input type="text" size="50" name="demo" value="<?php echo get_post_meta( $pid, 'sangvish_demo', true ); ?>" /> </p> </fieldset> <fieldset> <p><input type="submit" name="post_submit" value="<?php _e("Post Market Item", 'sangvish'); ?> >>" /></p> </fieldset> </form> <?php else: ?> <p><?php echo __('Admin have closed item Submission. Please contact the admin for any query.', 'sangvish'); ?></p> <?php endif ?> </div> <?php } ?> </div> <?php /* <div class="super-sidebar sidebar-right"> <h2 class="box-heading"><?php echo __('New to submit Items', 'sangvish'); ?></h2> <div class="container-box"> <p><?php echo __('In Order to get approved please follow the below instructions:', 'sangvish'); ?> </p> <?php echo ' <ul class="feature-list"> <li>'.__('Write good and explaining title.', 'sangvish').'</li> <li>'.__('Describe your item in detail.', 'sangvish').'</li> <li>'.__('Select a category.', 'sangvish').'</li> <li>'.__('Input tags seperated by comma.', 'sangvish').'</li> <li>'.__('Upload correct image and files with right Dimension and size.', 'sangvish').'</li> <li>'.__('Porn sites are not allowed', 'sangvish').'</li> <li>'.__('Add the correct price of your offer', 'sangvish').'</li> <li>'.__('Same item can be post it every 15 days otherwise your listing will be declined.', 'sangvish').'</li> </ul> <br /> <p>'.__('', 'sangvish').'</p>'; ?> </div> </div> */ ?> </div></div> <div class="clear"></div> <?php get_footer(); ?> PHP:
How did you create the new page? Where did you put it? The link provided returns a 404-error - which means it can't find the page at all, hence it's not where you think it is. The .htaccess you provided is the standard WP one, and has nothing to do with this problem - nor do the content of the file itself, from what I can see. The only thing I can think of, is that you somehow didn't put the page in the proper place, so hence, I'm asking, how did you make the page, and where exactly did you place it on the server?
@PoPSiCLe I added the page in the same location of post-new.php which is the main folder of the theme public_html/wp-content/themes/DigitalXFiles/post-new.php public_html/wp-content/themes/DigitalXFiles/post-new-form.php digitalxfiles.com/post-new/ (this works) digitalxfiles.com/post-new.php (Not Working) digitalxfiles.com/post-new-form/ (Not Working) digitalxfiles.com/post-new-form.php (Not Working) I don't what else to do or where to look for :S
It is not a rewrite rule, they are values stored in the database. You have to create a page template, then add the template to a custom page inside WP. You cannot just add a page to the directory because of the permalinks. It will not find it. Check here for an idea of what you need to do: http://codex.wordpress.org/Pages#Page_Templates