get the_content by ID and save the result to one array

You can use get_the_content() to fetch the post content, e.g.: $content = get_the_content( $post_id ); Then you can pass it through the_content filter and json encode However, based on your comments, it looks like you’re creating an endpoint for AJAX calls that returns post content. Don’t bother! WordPress comes with one out of the box! … Read more

In a multisite, how can I get posts from one site and display their permalinks in another site?

Let’s take a look at get_blog_permalink: get_blog_permalink( $blog_id, $post_id ) { switch_to_blog( $blog_id ); $link = get_permalink( $post_id ); restore_current_blog(); return $link; } As you can see, there’s no magic… But there are some problems, since switch_to_blog isn’t very efficient… It means that it would be way better if you’d done it this way: $tp_blog_id … Read more

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