1

All solutions for the questions I've seen is just about loading links to posts with a blog switching feature, but I need to show the post from my main blog on sub-blog under the requested URI on my sub-blog. That's crucial point. Maybe I have to redefine rendering, or hook something after receiving the content? Or even need to create something like a temporary page?

One more thing that could help to recognize the searching solution - I am using visual builder and all I, probably, need is a grabbing its JSON from the post and render it on the requested page of the sub-blog, but... the latter hasn't yet requested page in the database and how to make Wordpress to continue loading yet "unexisting" content, even after resetting 404, I haven't any idea, do you?

Bottom up:

  1. The content from the main blog should appear under the URI of sub-blog (crucial point).
  2. Need for the content only, there is no author and other post meta, and comments. There is just landing pages which are generated by a visual composer alike plugin.
  3. When the main blog content is updated then the sub-blog receives the same updates for the content.
  4. The sub-blog doesn't have corresponding page in its database table. So, it is loaded dynamically from the main blog in case when the pagename of the requested content unexists in the sub-blog but exists in the main blog.
  5. All the media saved on Amazon.
  6. A shared theme is used for every blog.

The reason of solution - to avoid multiple changes on the content for every blog, if those would appear, which should be the same across all the network.

3
  • This is a more complicated question than you describe. Do you mean that, when you publish a post on your main blog, you want the identical post content (or title and content, etc.) to appear as the content of a new post on your sub-blog? What about other post meta? Images or media? Comments? If the content at the main blog is updated, does the content at the sub-blog also get updated? Is the author identified? Is the author already a user at the sub-blog? In any event, all of this can be accomplished via the REST API, but a starting point is stating the objective clearly.
    – CK MacLeod
    Commented Jul 14, 2018 at 8:34
  • @CKMacLeod thanks for the reply. I have updated the description accordingly your questions. But I can't use REST API in my case, because rendering is done on the webserver and this is a requirement. Commented Jul 14, 2018 at 10:31
  • Actually, I am already retrieving the post, I still can't it render as it were loaded from the database table of the sub-blog. Commented Jul 14, 2018 at 10:46

1 Answer 1

0

Finally, I've found the solution by myself.

There is a the_posts filter hook we have in the Wordpress, which works after the system attempted to collect posts from a blog and, the most important, before defining the 404. Hooking it we can quickly update, or even modify, the array of posts, i.e. single post in my case, thus giving the system to continue working as nothing happened.

Due to that matter I've placed on the github the code of that tiny plugin and README with some explanations. If somebody will think that plugin should leave for the public audience, I would like to kindly ask to tell me about it, to continue development. Future ideas have been already placed in README.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.