Tag Info

Hot answers tagged

53

You can do that by copy your theme's page.php to a new file named something like user-profile.php and add to the very top of it this code: <?php /** * Template Name: User Profile * * Allow users to update their profiles from Frontend. * */ /* Get user info. */ global $current_user, $wp_roles; get_currentuserinfo(); /* Load the registration file. ...


17

Brady is correct that the best way to handle saving and displaying of custom post type orders is by using the menu_order property Here's the jquery to make the list sortable and to pass the data via ajax to wordpress: jQuery(document).ready(function($) { var itemList = $('#sortable'); itemList.sortable({ update: function(event, ui) ...


15

Uploading files in ajax is a bit tricky because it is not possible to upload files using the browser's XMLHttpRequest object so you need to use some kind of Ajax upload plugin and the easiest one would be the the JQuery Form Plugin which makes things much easier and it's included in WordPress. So to use it you need to enqueue it: ...


13

If you are talking about the answer i posted here its simply uploading file in an iframe to achieve "Ajax like" submit. Now if you already have a form that handles the post submit you can simply add the upload file field input somewhere in your form: <form ... ... <input type="file" name="thumbnail" id="thumbnail"> ... ... </form> make ...


10

<?php $postTitle = $_POST['post_title']; $post = $_POST['post']; $submit = $_POST['submit']; if(isset($submit)){ global $user_ID; $new_post = array( 'post_title' => $postTitle, 'post_content' => $post, 'post_status' => 'publish', 'post_date' => date('Y-m-d H:i:s'), 'post_author' => ...


9

You do cite experience with WP going back farther than that of mine... Yet I do not see these issues as that major. What scale of sites are we talking about? It's fairly slow I feel this is bit too much of generalization. Slow can be put in context of specific hardware, tasks and level of traffic. It's blanket statement otherwise. It's often overly ...


9

Its Not has hard as you think it is :) Add the password fields to your form : password: <input type="password" name="pass1" style="width:250px; margin-bottom:3px;"><br /> repeat password: <input type="password" name="pass2" style="width:250px; margin-bottom:3px;"><br /> then in your if($_POST){ replace this line: ...


7

There are a few functions that come in handy here: unstick_post - Unstick a post stick_post - Stick a post is_sticky - Figure out if a post is sticky With those three in mind, all we need to do is stick them together with some admin menu bar glue. First off, let's wrap everything in a class for fun and profit. This class will have some constants that ...


7

I use Advanced Custom Fields for lots of front end post editing with meta boxes. ACF allows you to build lots of advanced meta box fields and adds them automatically to the back end post panel. But there is a front end function as well. This method is completely free. The only way it costs anything is if you want to use any of their more complex field type ...


6

I actually wrote this for Happy Tables so should be able to give you a couple of pointers, though I don't have time to go into too much depth at the moment. We use this "image well" on tables tables a fair bit, it's basically the drag/drop upload from the WordPress upload. Similar to something like this: ...


6

Jeff Starr wrote a great tutorial on front-end registration, login and password recovery taking the similar approach as suggested by onetrickpony. So take this as a follow up to his answer and as another resource that might help you get it done: http://digwp.com/2010/12/login-register-password-code/ Now you have two examples how to code this yourself and ...


6

Yes it's possible. You have to create three filters for this. Admin stuff inside a class class WPSE29338_Admin { public static function setup() { add_filter('login_url', array(__CLASS__, 'modifyLoginURL'), 10, 2); add_filter('lostpassword_url', array(__CLASS__, 'modifyLostPasswordURL'), 10, 2); add_filter('register', ...


5

It is really not best practice to do it this way at all. In fact you don't need to create an ajax.php file unless you're just going to include it in your functions.php file. You need to read up on AJAX in WordPress. You would just add an action on 'wp_ajax_name_of_action' and just specify the action within the javascript ajax function. Simple example ...


5

Well, Thanks to wp 3.3 now we have wp_editor() function to do that :)


5

The WordPress function get_the_modified_author() will give you the author who last edited the current post. But if you want to list all the users that have edit the current post, you could try: function get_the_modified_authors_wpse_99226(){ global $wpdb; $authors = array(); $results = $wpdb->get_results( $wpdb->prepare("SELECT ...


5

The WP User Frontend plugin will meet all your needs. You can find the plugin here: https://wordpress.org/extend/plugins/wp-user-frontend/. The plugin gives ability to the user to create new post, edit post, edit profile from site frontend. So users doesn't need to enter the admin panel. Everything they need to do can be done from the frontend. If you do a ...


5

I wanted to provide you with a few ideas but once I started I couldn't stop myself and wrote this little plugin with an obscure name to get you started. <?php /* Plugin Name: WPSE Crowded Cats Plugin URI: http://wordpress.stackexchange.com/questions/43419/how-do-i-create-a-way-for-users-to-assign-categories-to-a-post-from-the-frontend Description: Allow ...


5

Here is a basic solutions for updating a post/page. I added a quick demo of custom meta fields. This is pretty basic, but will point you in the direction of plugin-less editing of posts on the front-end. This isn't super flexible, but you can add whatever you need to it. Add this code into your loop: <form id="post" class="post-edit front-end-form" ...


5

There's a global variable called $wp_scripts which is an instance of the WP_Scripts class. It doesn't have a public API for looking at registered or enqueued scripts, but you can look inside the object and see what's going on. You can see all the registered scripts with: global $wp_scripts; var_dump( $wp_scripts->registered ); To see the enqueued ...


5

A simple user meta row can handle that for you (the second issue), you can store the post id and the vote (up/down) in an array and that is just the same as post meta ex /** * update user vote per post * @param int $user_id * @param int $post_id * @param mixed $vote can be an integer 1 / -1 and can also be a string "up"/"down" * @return void */ ...


4

Never ever use your theme/plugin files directly for ajax calls, always use admin-ajax.php. This is the only recommended way of doing ajax to ensure maximum compatibility with wordpress (including future versions) & 3rd party plugins/themes The best/easiest way depends on the situation & is debatable but i would ask you to use admin-ajax.php even if ...


4

You could use AJAX to request a custom 'action' and send the users' ID. Alternatively 'post' the action and user ID to the same page. They are both essentially the same thing, but the former doesn't require the page to be reloaded. There are plenty of topics on this site that deal with AJAX, so I'll omit the details (check out the ajax tag for more ...


4

Simply put the wp_insert_post call inside your conditional check so its only called if the post title is not empty, something like this: if (empty($_POST['my_title'])){ echo 'error: please insert a title'; } else { $title = $_POST['my_title']; $new_post = array( 'post_title' => $title, 'post_status' => 'publish', ...


4

I think this small source code is your solution. It currently doesn't have frontend feedback for the Sticky Post change, but you can enhance this string, class or whatever you want in the function fb_stick_post. The first function adds the item in the Admin Bar and creates a new Url with a param value. Also, on click calls a function to read the Url param ...


4

If you are willing to pay for it, the Gravity Forms plugin allows you to create forms that map to your Custom Post Types (even regular post and page - types) as well as map to your custom fields. For those who aren't and who are willing to roll up their sleeves then you can create a front end form that posts data into any post type of your choosing quite ...


4

you can do that by running the function set_post_thumbnail( $my_post_id, $thumbnail_id ); remember, you have to process and insert the image into the library first: $uploaddir = wp_upload_dir(); $file = $_FILES[ ... whatever you have in your POST data ... ]; $uploadfile = $uploaddir['path'] . '/' . basename( $file ); move_uploaded_file( $file , ...


4

From the GitHub-Wiki The 'front_end_editor_disable'-filter Use this filter if you want to completely disable the plugin for certain URLs. Callback arguments: bool $disable: The current state. Default: false You can use conditional tags: Conditionals tags return bool true/false, which means, if you want to disable it on a page, simply use is_page(), as ...


4

There is no such action in the front end (in a theme) by default. Simply use a custom action like do_action( 'theme_notices' ); and hook into this one.


4

if I post today, it lists it as April 30th, 2013 (today is April 6th, 2013). Your using a lowercase t in your date format string. t Number of days in the given month 28 through 31 On Line 92: echo get_the_time('M-t-y \a\t g:ha' , $id); I think you meant to use d or j instead.


4

To add to what Rarst said but I think this post is border line trolling. 1.It's fairly slow You need to provide more details, a site with hundreds of thousands of pages and 1 million views a month is not the same as a regular blog/portfolio. It is rather simple and very common to have a WordPress site load in well under 2 second depending on ...



Only top voted, non community-wiki answers of a minimum length are eligible