scheurbert
Forum Replies Created
-
Forum: Developing with WordPress
In reply to: WordPress and JQuery – how get a post via ajaxI’ve been having the same troubles where I was sending a jQuery.ajax() post and it not actually sending any post data at all! I managed to fix it by appending an extra string on to the post URL (yeah, that old trick!). For example:
Within JS:
var now = new Date(); var time = Date.UTC(now.getFullYear(), now.getMonths(), now.getDate(), now.getHours(), now.getMinutes(), now.getSeconds(), now.getMilliseconds()); jQuery.ajax({ type: "POST", data: "&var1=Hello&var2=there", url: "https://example.com/?time="+time, success: function(results) { alert(results); } });
Or this way since I’ve got my JS code within a PHP file:
jQuery.ajax({ type: "POST", data: "&var1=Hello&var2=there", url: "https://example.com/?time=<?=time(); ?>", success: function(results) { alert(results); } });
I hope that helps someone. I wrote this code quickly in here so not too sure if the JS for the time constructor is correct!
Forum: Fixing WordPress
In reply to: Much ado about paged tag resultsAwesome, thanks for that! I should really learn more about that
query_posts
function as I think it could possibly clean up my existing messy SQL queries. I wonder if it’s possible to filter a post based on a particular meta value and order by the post date; I will do some research!Forum: Installing WordPress
In reply to: WordPress from WordPress: import problemActually, I wasn’t quite thorough with my evaluation of events. Seems the initial children’s
post_parent
of the root parent were set to the first child’sID
. Reading that sentence makes even my mind boggle so I will try to do an example.For example, post 20 is a parent. It has three children: 21, 22 and 23. After importing the XML into WordPress, post 21, 22 and 23’s
post_parent
have been set to 21 (the first child of 20).Forum: Installing WordPress
In reply to: WordPress from WordPress: import problemI had a problem where it would display some pages with children, but with others wouldn’t display the children, or even the parent page. I figured out a solution to it, however. For tech specs, I was using WordPress 2.1.0 on one server and importing to WordPress 2.1.3 on another server.
The problem I found was that the post ID *after* a root parent post (as in, one post that has children and no parent), that was also set as the root parent’s child, would stuff up showing any children for that root parent. For some reason that bung entry’s parent would be set the parent id of its own ID number, i.e. if its
ID
is 21, thepost_parent
would be set to 21, therefore mucking up the display in the Dashboard. All the posts/pages are in the SQL db, just with some mung data in thepost_parent
fields.In MySQL I ran the query:
UPDATE wp_posts SET post_parent = 0 WHERE post_parent = ID
That reset the mung posts’ parent value to 0 — no parent. Looking in the Manage > Pages it displayed all the pages but each one under a root parent post, it was reset to 0, but the following children under that particular root parent were still present and accounted for.
I’m not so good at explaining it but I hope some people garner some kind of assistance from my post.
It would seem that it was a problem in the exporting of the 2.1.0. Whether the bug is still there or not in the newer edition, and why it occurs (because there were pages with children that imported fine), I do not know.
Forum: Plugins
In reply to: Anyone ever tried this?Cool, thanks for your help. Puts many things in perspective. I guess I just needed to explore WP more rather than just plugins.
Thanks again