export category and sub-category
Workaround: export all import on a blank install (e.g.: in your computer) delete the unwanted ones export again
Workaround: export all import on a blank install (e.g.: in your computer) delete the unwanted ones export again
This kind of content scraping is frowned on. You’re trying to grab someone else’s content and put it into a transferable format over which they have no control. Yes, your intentions are sincere, but don’t be surprised if several people are hesitant to help. You do have some options, though. Contact the blog author This … Read more
Lol. I got reminded of this question when I got the Tumbleweed badge for having no answers and low views for a week. I didn’t figure out the right method for this but hacked through it by printing out the posts in a table format on the archive page for this custom post type and … Read more
Best practice to import/export specific pages and posts
The start of what you’re doing wrong can be explained by this quote: which action attribute points to a file (download.csv.php) in my plugin folder, that should not be shown, just prompt a file download dialog for the csv dump. and this code: $core = $_POST[‘download’].’wp-load.php’; if(isset($_POST[‘download’]) && is_file($core)){ require_once( $core ); What you’re basically … Read more
a quick and dirty way to do this is by running this ONCE: global $post; $posts = new WP_Query(); $posts->query(array(‘posts_per_page’ => -1, ‘post_type’ => ‘post’)); while ($posts->have_posts()): $posts->the_post(); $post->post_content = wpautop($post->post_content); // replaces new line chars with <p>’s wp_update_post($post); // updates the database endwhile; (didn’t test it) But how are you exporting your posts in … Read more
Your problem is that ob_file ain’t global. You only define it in c3m_export_xml(). Setting global $ob_file in ob_file_callback() gives you an empty file handle. Try this instead: function c3m_export_xml() { $args=array( ‘content’ => ‘posts’, ‘start_date’ => ‘october 2008’, ‘status’ => ‘published’); ob_start(); export_wp($args); $xml = ob_get_clean(); file_put_contents(‘server_path_to_my_file.xml’, $xml); }
Any difference between dev and prod is bad. Here is what I do: Have a different ip for dev server (Whether internal, external, or on local computer is unimportant) — but dev server must be the exact same setup (see bottom paragraph) Change the hosts file (see here) (on yours or a testing computer or … Read more
There are two basic approaches you can take. Use the standard wordpress inport / export plugin manually through the admin. Your custom post type must have the property can_export = true (default = true) If you go this route, there are interesting options for adding extra functionality for users, Check out this tutorial on adding … Read more
If you export a single post type (i.e. posts, pages, a custom post type, etc…) it will not include attached media files like featured images. That’s incredibly idiotic, to me, but your options are — Export everything from site (which will include featured images), then modify the XML file as needed before importing to the … Read more