How to convert and use JSON data from a remote WordPress server?

On server B: $result = wp_remote_post(‘http://serverA.com/?api=json’, array( ‘method’ => ‘POST’, ‘redirection’ => 1, ‘httpversion’ => ‘1.0’, ‘blocking’ => true, ‘headers’ => array(), ‘body’ => array(), ‘cookies’ => array() )); if ( is_wp_error( $result ) ) { return ‘bad connection!’; } $json = $result[‘body’]; $posts = json_decode($json); Now you have $posts as usual php array. var_dump($posts) … Read more

Problems clearing cache

After more than a half of a day of battle, I found out that style.css has to be in direct subdirectory of a child theme. I had placed it under the /css/ folder together with other styles. That’s why WordPress couldn’t find PHP files… Weird thing is that this folder structure has worked when I … Read more

WordPress sub-directory on other server running on nginx?

Just for sharing my experience to others: I have main site with domian.com and want to subdirectory domain.com/blog reverse proxy to blog.domain.com which is a wordpress with nginx! so this is how things work for me: HTTP version: 1- in domian.com nginx config set /blog like this: listen 80; server_name domain.com www.domain.com; location / { … Read more

How can I find the cause of a 500 server error?

Okay, here’s what I did. If this happens, hopefully this will work favourably for you. If this is disabled by default, enable wp-debug by changing the value from false to true. Check that you have enabled WP_DEBUG_LOG and WP_LOG_DISPLAY. Try refreshing the page and see what happens. Either using WinSCP or the terminal, go to … Read more