How to make post block w/ Multisite Data (Req?)

Posted in: Newsmag
Post count: 21

Note: I posted this at the codecanyon forum but thought it would be best if I switched it here. The code canyon thread is: http://themeforest.net/item/newsmag-news-magazine-newspaper/9512331/comments#comment_9730710

I run a multisite. The theme works perfectly in my network.

I have a posts block question: Is it possible to add some kind of code that would display content from a different site w/n my own network in a Post block 7 and/or Post Block 12?

Goal: My site is based on Washington DC information, http://www.SocialAlerts.com/washingtondc (DC) and I also have Both /virginia (VA) and /maryland (MD) sites in my multisite network as they are w/n 5 miles of DC. A lot of people live in VA/MD but work in DC and are looking for info for all three demographics.

My goal is to set up a post block 12 or post block 7 in /washingtondc that displays posts from /maryland and/or /virginia sites.

I’ve tried the wordpress rss block and it does NOT work well at all. The result is NOT compliant with your theme (none of the format is maintained, no featured image, no link back to the original post…)

Can you think of a way to do this and provide the code as a temp fix…and perhaps include an extra two fields in the post block setup that allows for same site multisite data in the future?

For example, simply by adding a field called “Multisite blog id” that utilizes “switchtoblog()” to grab data from the blog in question, and “multisite category id” that filters that blog data by the category IF the id is entered (and returns the last “x” number of posts from ALL cats if that id is not entered), then restoreblog() to return all data fetching to the pages current site should work perfectly. But I have no idea where to place this modification w/n your code…

Thanks

  • This topic was modified 11 years by efromdc.
  • This topic was modified 11 years by efromdc.
Post count: 21

Sorry – the correct “restore” function is restore_current_blog ->

https://codex.wordpress.org/WPMU_Functions/switch_to_blog

Thanks

Erik

Post count: 15
Post count: 21

Thats for widgets. How to I get the posts into a post block?

Post count: 21

Hello?

Viewing 5 posts - 1 through 5 (of 5 total)
The forum ‘Newsmag’ is closed to new topics and replies.