Skip to main content
7 events
when toggle format what by license comment
Nov 13 at 19:16 review Close votes
Nov 28 at 3:05
Nov 13 at 16:47 comment added Artemy Kaydash Sometimes websites in the same multisite network might have different IDs for categories so you might want to try get categories by their names or slugs first
Nov 13 at 15:10 comment added Caleb I tested this on a fresh install of WP 6.7 and had no issue. So no, not normal behavior, and a custom SQL query shouldn't be needed. There's likely something interfering (from theme or plugin). You may be able to use a tool like Query Monitor to review the queries and see if it's being altered.
Nov 13 at 13:55 comment added Ben It's the ID of the specific category from the blog I want to get the posts from. I'm aware that they are not the same. Also when I try to get the said category it works perfectly : switch_to_blog(1); get_category(1);
Nov 13 at 13:16 comment added Tom J Nowell how are you getting the ID of the specific category? Note that a category might not have the same ID on the other site, even if it shares the same slug/name, because they aren't the same category, they're just categories on separate sites that happen to share a name
S Nov 13 at 13:03 review First questions
Nov 13 at 18:58
S Nov 13 at 13:03 history asked Ben CC BY-SA 4.0