Front end login form not working on live site

I am using the front end form submission. It works on localhost perfectly, but it's not working when my site is live. It shows the "success message", but originally it's not logged in. This is my code: if ( 'POST' == $_SERVER['REQUEST_METHOD'] && !empty( $_POST['action'] ) && $_POST['action'] == 'log-in' ) : global $error; $login = wp_login( $_POST['user-name'], $_POST['password'] ); $login = wp_signon( array( 'user_login' => $_POST['user-name'], 'user_password' => $_POST['password'], 'remember' => $_POST['remember-me'] ), false ); if (!$error) { save_message( …
Category: Web

using wp_insert_term to create custom terms for a custom taxonomy from frontend form,

I have a form which allows certain roles to add custom terms to a taxonomy. My taxonomy is called Genre (slug genre) <form method='post' enctype='multipart/form-data'> <input type="text" value="" name="new"> <input type='submit' name='Save'> </form> I have been going around in circles with this for hours. Ive searched for other questions similar and have tried the suggestions. I am using https://wordpress.org/plugins/custom-post-type-ui/ to create the custom taxonomies - Was wondering maybe my script is firing before this plugin does and therefore wp_insert_terms happens …
Category: Web

How to include backend buttons css on frontend?

I want to include backend buttons css on frontend in a plugin? This is how its inluded in backend: http://localhost/wp-admin/load-styles.php?c=1&dir=ltr&load=admin-bar,wp-admin,buttons,wp-auth-check&ver=3.6.1 How to include it in the frontend?
Category: Web

How to change custom post order ASC/DESC menu_order wise dynamically?

I have created custom post type in back end with sort menu_order post as you can see in the screenshot. http://prntscr.com/gacw95 In back end sorting ASCENDING/DESCENDING working fine. But I need to Sort ASC/DESC on the front side also. When I click on order tab in back end It will be sorting the post in back end but not in front end. How can I sort the custom post in front side when change in the back end? Backend code …
Category: Web

Wordpress website working fine on localhost but not displaying front pages on webhost

The website works perfect on my localhost. I used duplicator plugin to upload it on my web-host. Database connections are established since mywebsite.com/wp-admin works perfect. I can login the wordpress wp-admin panel and all the plugins, pages, posts are there and are editable. Also the permalink on the homepage shows as http://mywebsite.com But when I open my website I see an absolutely blank page. There is no code in inspect element or no errors in console log. Website can be …
Category: Web

User profile in front-end

I want every user to get a profile in the front-end of my website. So I want to visit website.com/user/user-name and view all the information of this user. Is this somehow possible? I would like to do this without a plug-in. All things I'll found on Google did include a plug-in like Front-End Only Users..
Category: Web

Translation for frontend

In my plugin I have many strings to translate for the backend and only a few for the frontend. For the visitors of the website it is nicer to read the words in the language of the site. Is there a more elegant way to mark for the translators which words appear in the frontend or backend than _x: _x("string to translate", "In Frontend", "text-domain") Thank you very much.
Category: Web

Insert wp_editor on front-end with AJAX?

I'm trying to insert a wp_editor() into a page on the front-end with AJAX. The code I have right now inserts the wp_editor elements and the needed JavaScript and CSS files, but none of the settings I used initially in wp_editor() are used when creating this TinyMCE element. How do I pass the $settings set in PHP into the dynamically created TinyMCE instance? I found an old question that seems to answer my question, but I don't understand how it …
Category: Web

How to upload PDF from Front-End and post automatically?

I have a medical client and they want to upload and post pdf automatically. So I stumbled upon frontend uploader, which allows users to upload and post an image to a blog post. It does however post with a pdf, but it goes straight to the media library. So a alternative solution I came up with is getting the pdf to jpeg, and then just upload the jpeg along with the blog post.
Category: Web

How do I include a TinyMCE editor in the frontend?

I am trying to add a TinyMCE editor in my frontend from where users can post but have had no luck so far. Here is the code: PHP: add_action('wp_print_scripts', 'my_enqueue_scripts'); function my_enqueue_scripts() { wp_enqueue_script( 'tiny_mce' ); if (function_exists('wp_tiny_mce')) wp_tiny_mce(); } Javascript: jQuery(document).ready(function(){ tinyMCE.init({ mode : "textareas", theme : "simple", /*plugins : "autolink, lists, spellchecker, style, layer, table, advhr, advimage, advlink, emotions, iespell, inlinepopups, insertdatetime, preview, media, searchreplace, print, contextmenu, paste, directionality, fullscreen, noneditable, visualchars, nonbreaking, xhtmlxtras, template",*/ editor_selector :"editor" }); …
Category: Web

Stop/Pause WordPress Heartbeat using Javascript

I use the WordPress heartbeat to check a setting on my server from the front-end. If that setting has a specific value I want to stop bothering the server. There for I want to stop/pause the heartbeat. There are no other things depending on the heartbeat. I found wp.heartbeat.stop() over here, but it doesn't work. jQuery(document).ready(function ($) { $(document).on('heartbeat-tick', function (e, data) { [...] if (true == x) { wp.heartbeat.stop(); } [...] } }); I get this error in the …
Category: Web

Front End Page Not Loading Header Footer

I followed the directions at http://blog.frontendfactory.com/how-to-create-front-end-page-from-your-wordpress-plugin/ and it works but the header and footer do not load. Here is my page: http://pocket.consulting/bg-core/ UPDATE: I stand corrected... It appears the wp_head(); and wp_footer(); do load as it is altering the color, font, etc. Is there something else I have to call to get the entire look/feel?
Category: Web

Update user meta via ajax from frontend, saving issue

I want to save/update a custom user meta field from the frontend, via ajax. This field should hold a list of post ID´s. No double ID´s should allowed. My problem is that my field value get saved as an multidimension array, every time I update it. For example the saved data looks like this: Array ( [0] => Array ( [0] => Array ( [0] => [1] => 70 [2] => 79 ) [1] => 79 ) [1] => 93 …
Category: Web

Multi Photo Upload with Caption on Front End for Custom Post Type

I have a page template that allows users to create posts (for a custom post type) on the front end and upload (multiple) images. Currently it works fine but I would like to enhance it by adding the ability to give each photo a title/caption to be used on the single post page. On top of my page I have code for saving the fields such as -- $property_sights_value = get_post_meta($Property_Id, 'imic_property_sights', false); And - if (!empty($_FILES['sightMulti']['tmp_name'][0])) { $i = …
Category: Web

Redirect back to origin page after using get_delete_post_link()

I need to implement frontend and backend redirection after delete specific post using get_delete_post_link(). Which hook i can use? Any advice would be appreciated. Something similar to : <?php echo wp_login_url( $redirect ); ?> I need to redirect to front-end page after post deleted, similar to wp_login_url can do. As Barry said my code might look like below: add_filter( 'get_delete_post_link', 'some_function', 20 ); function some_function() { wp_redirect( get_permalink() ); exit; } Assume get_permalink will get current page where get_delete_post_link called. …
Category: Web

Using Gravity Forms to upload media into library, then attach to post

I have a simple site with two Gravity Forms, both of which allow users to upload media. I'm looking for some simple code that: (a) inserts all uploaded media into the Media Library and not the default Gravity Forms folder (b) attaches media to pages. Form 1 attach to page 1, form 2 to page 2. I've found a few similar posts, but nothing simple that does exactly what I need. I guess I'd use something like add_action( 'gform_after_submission_1', 'after_submission', …
Category: Web

Disable front end to use as CMS only?

I'm using the WordPress database and back end to administer the news for my band's website and everything is working great however I'd like to disable the front end of WordPress itself. I have the WordPress installation installed in /wordpress/ and obviously the admin section is under /wordpress/wp-admin/. What would be the best way to restrict someone from accessing the rather *un*setup WordPress site itself without affecting the admin section? If anything, I could simply redirect to the website's proper …
Category: Web

About

Geeks Mental is a community that publishes articles and tutorials about Web, Android, Data Science, new techniques and Linux security.