Sync posts from one WordPress site to another

Have you tried codex.wordpress.org/XML-RPC_Support. This code works, in conjunction with the IXR library found at incutio: include(‘IXR_Library.php’); $usr=”theusername”; $pwd = ‘thepassword’; $xmlrpc=”http://not-therealurl.com/xmlrpc.php”; $client = new IXR_Client($xmlrpc); $client -> debug = true; //optional but useful $params = array( ‘post_type’ => ‘post’, ‘post_status’ => ‘draft’, ‘post_title’ => ‘Test Post’, ‘post_author’ => 4, ‘post_excerpt’ => ‘This is my … Read more

Multiple endpoints in one URL

Not sure of the context for this, is it a custom post type or just a page? This might be something which you’re looking for – function add_lead_management_endpoints() { add_rewrite_rule( ‘manage-lead/lead_id/([0-9]{1,})/product_id/([0-9]{1,})’, ‘index.php?pagename=manage-lead&lead_id=$matches[1]&product_id=$matches[2]’, ‘top’ ); add_rewrite_tag( ‘%lead_id%’, ‘([^&]+)’ ); add_rewrite_tag( ‘%product_id%’, ‘([^&]+)’ ); } add_action( ‘init’, ‘add_lead_management_endpoints’ ); You’ll need to flush permalinks for this to … Read more

Add rewrite endpoint to author page + pagination

Your code should works. The line: include (get_template_directory_uri() . ‘/articles.php’); Needs to have allow_url_include=1 in the server configration because you are trying to include a file via http. Can you check this? You must know also that template_redirect should be use for a real redirect, a include() may have undesired effects here. I think what … Read more

WordPress 4.7 REST API endpoints

According to ticket #38373 the following endpoints will be supported in version 4.7. Let me quote Rachel Baker: REST API endpoints for your WordPress content. These endpoints provide machine-readable external access to your WordPress site with a clear, standards-driven interface, allowing new and innovative apps for interacting with your site. These endpoints support all of … Read more

Widget with random posts from a blog for external sites

To create a special output of random posts: Register an endpoint to the root of your blog. See A (Mostly) Complete Guide to the WordPress Rewrite API for details. Refresh the permalink settings. I would do this on (de)activation only. Hook into ‘template_redirect’ and return your output depending on the details of the requested endpoint. … Read more

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