How to copy posts from one site to another in real time (not multisite)
How to copy posts from one site to another in real time (not multisite)
How to copy posts from one site to another in real time (not multisite)
You can use (according to docu over @wp-ecommerce) global $wpsc_query; to modify your query. Resetting the loop can be done with wpsc_rewind_products(); right before the second call to while (wpsc_have_products()) : wpsc_the_product(); For the final solution, pls read the comments below.
try putting your script in a function and running it during an action hook. perhaps the wp_footer hook.
Unfortunately, this fine plugin (Add Clone Sites for WPMU (batch)) doesn’t do that… From its FAQ: Why can’t I clone the main site? I chose not to because the main site can be slightly different in structure than a new network site. Albeit a little chaotic and difficult to search, there’s very good info about … Read more
You’re running a separate query for every tag, which aside from being wasteful is also causing the repeat posts. You should rewrite the code to make only one query that looks for all tags. Try something along the lines of this: <?php // Generate an array of taxonomy IDs $tax_IDs = array(); foreach ($tags as … Read more
You have got a few things to consider here. Let’s start the way the Browser does. You build up the HTML, so far so good, containing the Structure and everything for your site. No articles are shown. The next step your Browser has to do is make the AJAX call. Here are the first things … Read more
Problem is within function query_abstract_post_table where you have ‘$ids’ wrapped in single quotes: Problem: $sql = “SELECT * FROM $table_name WHERE ID NOT IN (‘$ids’)”; In the above example, only the first ID returned in the concatenated string (from the array) will be recognized by the NOT IN clause. Solution: $sql = “SELECT * FROM … Read more
Theory As WordPress doesn’t have some sort of geolocation detection script built in, we’ll have to make our own. As this script is javascript, we then need to get the resulting location data to php. Then we’re able to do a request or add something to our request. I’ll now give you parts of code, … Read more
Filter wp_unique_post_slug. Make sure to add the callback with 6 as last argument to get the original slug. Then create a new unique slug as you need it, you get a lot of context information. add_filter( ‘wp_unique_post_slug’, function ( $slug, $post_ID, $post_status, $post_type, $post_parent, $original_slug ) { // create a new unique slug based on … Read more
Editing the permalink manually would be the safest route. If you’re comfortable using phpMyAdmin, you could create a MySQL query to update them all in one batch. Slightly more work than auto-assigning a slug, but it doesn’t require a lot of coding to try to re-calculate the slugs. update wp_posts SET post_name=”new-slug” WHERE post_name=”old-slug”; (You … Read more