wpdb query problem to access previous 3 days posts

You are asking for the last three posts ordered by post date, not for the posts from the last three days– ORDER BY post_date DESC LIMIT 3. post_date has a time component to it. It is not just marked with a date. Even so, that LIMIT would restrict the query to last three in the … Read more

Form Shortcode not saving data to WP database

Ok, for some reason it’s now working. Instead of hooking into ‘init’ I’ve used ‘the_post’ and the form shortcode does it’s job. I no longer have an issue with publishing a new post or the data not saving. Also, no “Cannot modify header information – headers already sent” error. The function function el_process_form(){ if( $_SERVER[‘REQUEST_METHOD’] … Read more

Creating a post from data returned from HTML form

I worked it out and re-wrote the code: jQuery(document).ready(function() { jQuery(‘#createacostume’).submit(function( event ) { event.preventDefault(); var aForm = jQuery(this); var bForm = aForm.serializeArray(); bForm.push({name: ‘action’, value: ‘myAjaxFunction’}); jQuery.ajax({ url: ajaxurl, type: “POST”, data: bForm, success: function(resp) { alert(“Thank you for your post. We will review it and approve it shortly” + resp); }, error: function( … Read more

301 Redirect Code

Assuming that the url parsing is correct and the data is actually set up correctly in the DB I think your SQL query is wrong. My suggestion is that you replace it by calling wp_query() api with the relevant parameters. Another suggestion that might not be a bug is not to use guid, as it … Read more

Super administrator db name

The administrator role is defined by the capabilities the user has. Those are stored in the wp_user_meta table for each user. If you’re on multisite, an additional set of capabilities is assigned to a Super Admin. The Codex tells us what capabilities we can check for in code to see if a user is an … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)