May be this is not a good question, but I couldn’t find a proper solution for my issue yet. So I’m planing to post that over here.

Question in Brief

I have to implement a separate url for each blog post with a different look but with same content as it is in the original blog post.

More Details

We are planing to build new mobile app for our blog. So in the app we are planing to load the blog post via web url. But we can’t use the original url as it has many unnecessary things(widget,extra links) when we think about the load & the design perspectives. So we plan to have different url for each post which has a different theme but with same content as it is in original post.

However for normal blog uses who use the blog with mobile devices, still get the original blog view(we are using responsive design). That means We doesn’t need to use different theme for mobile uses specially.

Why no API

Also we didn’t go with the API & rebuild the things within the mobile app due to following reasons,

  1. we should have a same design as it is in the web
  2. reproducing that in the app take a while & can’t achieve 100%
  3. we can reuse it for android & windows in future
  4. design changes can easily implemented

Example

Suppose I have a post on my blog with the url www.example.com/sample_post, this will work in anywhere including mobile devices.

But we need separate url like m.example.com/sample_post with the same post content as it is in the main url but with different theme which has only the post content(no extra widgets & all). This url we could only be using within the mobile app and we plan to use SEO unfollow meta tags. So there won’t be any downfalls for SEO side as content reproduce.

I have edited the question with more details which makes easy to understand with the help of comment & answers so far. I hope you will get clear idea the question now.

2 Answers
2

As of clarification via comment, you really don’t need a additional version, subdomain with the same content. What you need is to get the post content, nothing more. The styling and such should happen in your app, not by pulling it from the site. At least that’s how I feel about it.

Anyhow, for this you can use WP REST API. It is partly integrated into core and will be integrated completely, for now you can extend on the already implemented functionality by using the plugin version of the API. Below I link you some resources. There is a stable, but deprecated, version 1.2.5 and a version 2.0-beta13.1 of the plugin. Personally I would definitely go with the version 2 beta, because it is well on its way. But you have to read up on it yourself, so you can make a educated decision on your own.

  • Make WordPress Core: WP REST API
  • GitHub: WP REST API
  • WP REST API V1 @ WordPress Plugin Repository
  • WP REST API V1 Documentation
  • WP REST API V2 @ WordPress Plugin Repository
  • WP REST API V2 Documentation

Edit:

Ok, another suggestion, but as said in the comment, I am not convinced it is the best approach.

You could duplicate the content in a similar way as MultilingualPress does it. It works with single sites of a multisite setup. Although it is a translation plugin, there isn’t actually a need to translate. Besides this just a proposal, which you can use for orientation.

  • MultilingualPress @ WordPress Plugin Repository
  • GitHub: MultilingualPress

Leave a Reply

Your email address will not be published. Required fields are marked *