{"id":4191,"date":"2021-02-20T10:15:27","date_gmt":"2021-02-20T15:15:27","guid":{"rendered":"https:\/\/themespress.ca\/?p=4191"},"modified":"2021-07-07T06:20:50","modified_gmt":"2021-07-07T10:20:50","slug":"query-wordpress-multisite-network","status":"publish","type":"post","link":"https:\/\/themespress.ca\/en\/query-wordpress-multisite-network\/","title":{"rendered":"Create a Query With a WordPress Multisite Network"},"content":{"rendered":"<div class=\"wpb-content-wrapper\"><div class=\"vc_row wpb_row vc_row-fluid\"><div class=\"wpb_column vc_column_container vc_col-sm-12\"><div class=\"vc_column-inner\"><div class=\"wpb_wrapper\">\n\t<div class=\"wpb_text_column wpb_content_element\" >\n\t\t<div class=\"wpb_wrapper\">\n\t\t\t<p>In this tutorial we will show how to create a query that will pull a specific website&#8217;s post type within the multisite network. <\/p>\n<p>In order to attain this, we will use the <a href=\"https:\/\/developer.wordpress.org\/reference\/functions\/switch_to_blog\/\" target=\"_blank\" rel=\"noopener\"><strong>switch_to_blog();<\/strong><\/a> function and find the blog ID that matches the website&#8217;s ID where we want to pull the post type data from. <\/p>\n<p>Dans notre exemple ci-dessous, nous allons renvoyer nos r\u00e9sultats dans un shortcode du nom de [listeentreprises]. <strong>Ce shortcode affichera les r\u00e9sultats par exemple dans une page d\u2019un autre site web du multisite.<\/strong> In the example below, we will generate our results with a shortcode titled [listeentreprises]. <strong>This shortcode will display the results on a page of another website from the multisite network.<\/strong> <\/p>\n<p>We need to create our <strong>switch_to_blog(3)<\/strong> and close it with <strong><a href=\"https:\/\/developer.wordpress.org\/reference\/functions\/restore_current_blog\/\" target=\"_blank\" rel=\"noopener\">restore_current_blog<\/a><\/strong> which will create the multisite query. The ID 3 is our website&#8217;s ID. <\/p>\n\n\t\t<\/div>\n\t<\/div>\n<div id=\"ts-enlighterjs-container-4766264\" class=\"ts-enlighterjs-container-single-enabled  \" style=\"width: 100%;  margin-top: 0px; margin-bottom: 0px;\" data-enlighter-doubleclick=\"true\" data-enlighter-windowbutton=\"true\" data-enlighter-windowtext=\"New Window\" data-enlighter-rawbutton=\"true\" data-enlighter-rawtext=\"RAW Code\" data-enlighter-infobutton=\"false\" data-enlighter-infotext=\"EnlighterJS\" data-enlighter-indent=\"2\"><pre id=\"ts-enlighterjs-pre-4766264\" class=\"\" style=\"white-space: pre-wrap; height: 100%; margin: 0; padding: 0;\" data-enlighter-language=\"php\" data-enlighter-theme=\"enlighter\" data-enlighter-group=\"\" data-enlighter-title=\"\" data-enlighter-linenumbers=\"true\" data-enlighter-lineoffset=\"1\" data-enlighter-highlight=\"\">\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/ Shortcode Afficher entreprises \/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\nadd_shortcode(&#039;listeentreprises&#039;, &#039;themespress_afficher_entreprise&#039;);\nfunction themespress_afficher_entreprise() {\n    \/\/ Requete de l&#039;ID de notre site web\n    switch_to_blog(3);\n\n    \/\/ pr&eacute;parer la query pour r&eacute;cup&eacute;rer le post type &agrave; afficher\n    $args = array(\n        &#039;post_type&#039; =&gt; &#039;votreposttype&#039;,\n\t&#039;posts_per_page&#039; =&gt; -1,\n\t&#039;order&#039; =&gt; &#039;ASC&#039;,\n        &#039;orderby&#039; =&gt; &#039;title&#039;,\n    );\n    $the_query = new WP_Query( $args );\n\n    echo&#039;&lt;ul&gt;&#039;;\n\t\n\t  while ( $the_query-&gt;have_posts() ) { $the_query-&gt;the_post();\n\t\techo &#039;&lt;li&gt;&#039; . get_the_title() . &#039;&lt;\/li&gt;&#039;;\n         }\n    echo&#039;&lt;\/ul&gt;&#039;;\n\n    \/\/ revenir &agrave; Local d&rsquo;abord\n    restore_current_blog();\n    return $entreprise;\n}<\/pre><\/div><h2 style=\"text-align: left\" class=\"vc_custom_heading vc_do_custom_heading\" >Afficher une vue formidable form dans un multisite WordPress<\/h2>\n\t<div class=\"wpb_text_column wpb_content_element\" >\n\t\t<div class=\"wpb_wrapper\">\n\t\t\t<p> We have now created our results which included entreprise Post Type.<\/p>\n<p>Following the same logic, we will create a shortcode and a <strong>return shortcode with Vue <a href=\"https:\/\/shareasale.com\/r.cfm?b=841990&amp;u=1476870&amp;m=64739&amp;urllink=&amp;afftrack=0\" target=\"_blank\" rel=\"noopener\">Formidable Form<\/a>.<\/strong><\/p>\n<p>Our shortcode in the example below will be [vuespost]. <strong>This shortcode will display the results in a page of another website within the multisite network<\/strong><\/p>\n<p>Replace it by yours.<\/p>\n\n\t\t<\/div>\n\t<\/div>\n<div id=\"ts-enlighterjs-container-7738755\" class=\"ts-enlighterjs-container-single-enabled  \" style=\"width: 100%;  margin-top: 0px; margin-bottom: 0px;\" data-enlighter-doubleclick=\"true\" data-enlighter-windowbutton=\"true\" data-enlighter-windowtext=\"New Window\" data-enlighter-rawbutton=\"true\" data-enlighter-rawtext=\"RAW Code\" data-enlighter-infobutton=\"false\" data-enlighter-infotext=\"EnlighterJS\" data-enlighter-indent=\"2\"><pre id=\"ts-enlighterjs-pre-7738755\" class=\"\" style=\"white-space: pre-wrap; height: 100%; margin: 0; padding: 0;\" data-enlighter-language=\"php\" data-enlighter-theme=\"enlighter\" data-enlighter-group=\"\" data-enlighter-title=\"\" data-enlighter-linenumbers=\"true\" data-enlighter-lineoffset=\"1\" data-enlighter-highlight=\"\">\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/ Afficher vue formidable form  \/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\nadd_shortcode(&#039;vuespost&#039;, &#039;themespress_vuesPOST_shortcode&#039;);\nfunction themespress_vuesPOST_shortcode(){\n\t\/\/ Requete de l&#039;ID de notre site web\n        switch_to_blog(3);\n\t$output = do_shortcode(&#039;[display-frm-data id=25033]&#039;);\n\trestore_current_blog();\n\treturn $output;\n}<\/pre><\/div><div class=\"vc_empty_space\"   style=\"height: 20px\"><span class=\"vc_empty_space_inner\"><\/span><\/div>\n\t<div class=\"wpb_text_column wpb_content_element\" >\n\t\t<div class=\"wpb_wrapper\">\n\t\t\t<p><strong>NB : Make sure to do a backup of your theme and dabatase before using these functions.<\/strong><\/p>\n\n\t\t<\/div>\n\t<\/div>\n<\/div><\/div><\/div><\/div>\n<\/div>","protected":false},"excerpt":{"rendered":"In this tutorial we will show how to create a query that will pull a specific website's post type within the multisite network. In order to attain this, we will<div class=\"read-more\"><a class=\"btn button-secondary\" href=\"https:\/\/themespress.ca\/en\/query-wordpress-multisite-network\/\">Read More<\/a><\/div>","protected":false},"author":81,"featured_media":4026,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"inline_featured_image":false,"footnotes":""},"categories":[283],"tags":[],"class_list":["post-4191","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-tutorials"],"aioseo_notices":[],"aioseo_head":"\n\t\t<!-- All in One SEO 4.9.10 - aioseo.com -->\n\t<meta name=\"description\" content=\"Share the post &quot;Create a Query With a WordPress Multisite Network&quot; Facebook LinkedIn Twitter Partager... E-mail Ajouter aux favoris Bluesky In this tutorial we will show how to create a query that will pull a specific website\u2019s post type within the multisite network. In order to attain this, we will use the switch_to_blog(); function and\" \/>\n\t<meta name=\"robots\" content=\"max-image-preview:large\" \/>\n\t<meta name=\"author\" content=\"Daniel\"\/>\n\t<link rel=\"canonical\" href=\"https:\/\/themespress.ca\/en\/query-wordpress-multisite-network\/\" \/>\n\t<meta name=\"generator\" content=\"All in One SEO (AIOSEO) 4.9.10\" \/>\n\t\t<meta property=\"og:locale\" content=\"en_US\" \/>\n\t\t<meta property=\"og:site_name\" content=\"Themespress - Des tutoriels et ressources WordPress\" \/>\n\t\t<meta property=\"og:type\" content=\"article\" \/>\n\t\t<meta property=\"og:title\" content=\"Create a Query With a WordPress Multisite Network - Themespress\" \/>\n\t\t<meta property=\"og:description\" content=\"Share the post &quot;Create a Query With a WordPress Multisite Network&quot; Facebook LinkedIn Twitter Partager... E-mail Ajouter aux favoris Bluesky In this tutorial we will show how to create a query that will pull a specific website\u2019s post type within the multisite network. In order to attain this, we will use the switch_to_blog(); function and\" \/>\n\t\t<meta property=\"og:url\" content=\"https:\/\/themespress.ca\/en\/query-wordpress-multisite-network\/\" \/>\n\t\t<meta property=\"article:published_time\" content=\"2021-02-20T15:15:27-05:00\" \/>\n\t\t<meta property=\"article:modified_time\" content=\"2021-07-07T10:20:50-04:00\" \/>\n\t\t<meta name=\"twitter:card\" content=\"summary\" \/>\n\t\t<meta name=\"twitter:title\" content=\"Create a Query With a WordPress Multisite Network - Themespress\" \/>\n\t\t<meta name=\"twitter:description\" content=\"Share the post &quot;Create a Query With a WordPress Multisite Network&quot; Facebook LinkedIn Twitter Partager... E-mail Ajouter aux favoris Bluesky In this tutorial we will show how to create a query that will pull a specific website\u2019s post type within the multisite network. In order to attain this, we will use the switch_to_blog(); function and\" \/>\n\t\t<script type=\"application\/ld+json\" class=\"aioseo-schema\">\n\t\t\t{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"BlogPosting\",\"@id\":\"https:\\\/\\\/themespress.ca\\\/en\\\/query-wordpress-multisite-network\\\/#blogposting\",\"name\":\"Create a Query With a WordPress Multisite Network - Themespress\",\"headline\":\"Create a Query With a WordPress Multisite Network\",\"author\":{\"@id\":\"https:\\\/\\\/themespress.ca\\\/en\\\/author\\\/daniel\\\/#author\"},\"publisher\":{\"@id\":\"https:\\\/\\\/themespress.ca\\\/en\\\/#organization\"},\"image\":{\"@type\":\"ImageObject\",\"url\":\"https:\\\/\\\/themespress.ca\\\/wp-content\\\/uploads\\\/2021\\\/02\\\/Creer-une-requete-dans-un-multisite-WordPress.jpg\",\"width\":1920,\"height\":1184,\"caption\":\"Cr\\u00e9er une requ\\u00eate dans un multisite WordPress\"},\"datePublished\":\"2021-02-20T10:15:27-05:00\",\"dateModified\":\"2021-07-07T06:20:50-04:00\",\"inLanguage\":\"en-US\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/themespress.ca\\\/en\\\/query-wordpress-multisite-network\\\/#webpage\"},\"isPartOf\":{\"@id\":\"https:\\\/\\\/themespress.ca\\\/en\\\/query-wordpress-multisite-network\\\/#webpage\"},\"articleSection\":\"Tutorials, Optional\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/themespress.ca\\\/en\\\/query-wordpress-multisite-network\\\/#breadcrumblist\",\"itemListElement\":[{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/themespress.ca\\\/en\\\/#listItem\",\"position\":1,\"name\":\"Accueil\",\"item\":\"https:\\\/\\\/themespress.ca\\\/en\\\/\",\"nextItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/themespress.ca\\\/en\\\/categorie\\\/tutorials\\\/#listItem\",\"name\":\"Tutorials\"}},{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/themespress.ca\\\/en\\\/categorie\\\/tutorials\\\/#listItem\",\"position\":2,\"name\":\"Tutorials\",\"item\":\"https:\\\/\\\/themespress.ca\\\/en\\\/categorie\\\/tutorials\\\/\",\"nextItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/themespress.ca\\\/en\\\/query-wordpress-multisite-network\\\/#listItem\",\"name\":\"Create a Query With a WordPress Multisite Network\"},\"previousItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/themespress.ca\\\/en\\\/#listItem\",\"name\":\"Accueil\"}},{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/themespress.ca\\\/en\\\/query-wordpress-multisite-network\\\/#listItem\",\"position\":3,\"name\":\"Create a Query With a WordPress Multisite Network\",\"previousItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/themespress.ca\\\/en\\\/categorie\\\/tutorials\\\/#listItem\",\"name\":\"Tutorials\"}}]},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/themespress.ca\\\/en\\\/#organization\",\"name\":\"Themespress\",\"description\":\"Des tutoriels et ressources WordPress\",\"url\":\"https:\\\/\\\/themespress.ca\\\/en\\\/\"},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/themespress.ca\\\/en\\\/author\\\/daniel\\\/#author\",\"url\":\"https:\\\/\\\/themespress.ca\\\/en\\\/author\\\/daniel\\\/\",\"name\":\"Daniel\",\"image\":{\"@type\":\"ImageObject\",\"@id\":\"https:\\\/\\\/themespress.ca\\\/en\\\/query-wordpress-multisite-network\\\/#authorImage\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/93cd2188e40b3289d305e88acb676eb8b84078e50e06f4eb38a0152903b34c9d?s=96&d=mm&r=g\",\"width\":96,\"height\":96,\"caption\":\"Daniel\"}},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/themespress.ca\\\/en\\\/query-wordpress-multisite-network\\\/#webpage\",\"url\":\"https:\\\/\\\/themespress.ca\\\/en\\\/query-wordpress-multisite-network\\\/\",\"name\":\"Create a Query With a WordPress Multisite Network - Themespress\",\"description\":\"Share the post \\\"Create a Query With a WordPress Multisite Network\\\" Facebook LinkedIn Twitter Partager... E-mail Ajouter aux favoris Bluesky In this tutorial we will show how to create a query that will pull a specific website\\u2019s post type within the multisite network. In order to attain this, we will use the switch_to_blog(); function and\",\"inLanguage\":\"en-US\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/themespress.ca\\\/en\\\/#website\"},\"breadcrumb\":{\"@id\":\"https:\\\/\\\/themespress.ca\\\/en\\\/query-wordpress-multisite-network\\\/#breadcrumblist\"},\"author\":{\"@id\":\"https:\\\/\\\/themespress.ca\\\/en\\\/author\\\/daniel\\\/#author\"},\"creator\":{\"@id\":\"https:\\\/\\\/themespress.ca\\\/en\\\/author\\\/daniel\\\/#author\"},\"image\":{\"@type\":\"ImageObject\",\"url\":\"https:\\\/\\\/themespress.ca\\\/wp-content\\\/uploads\\\/2021\\\/02\\\/Creer-une-requete-dans-un-multisite-WordPress.jpg\",\"@id\":\"https:\\\/\\\/themespress.ca\\\/en\\\/query-wordpress-multisite-network\\\/#mainImage\",\"width\":1920,\"height\":1184,\"caption\":\"Cr\\u00e9er une requ\\u00eate dans un multisite WordPress\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/themespress.ca\\\/en\\\/query-wordpress-multisite-network\\\/#mainImage\"},\"datePublished\":\"2021-02-20T10:15:27-05:00\",\"dateModified\":\"2021-07-07T06:20:50-04:00\"},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/themespress.ca\\\/en\\\/#website\",\"url\":\"https:\\\/\\\/themespress.ca\\\/en\\\/\",\"name\":\"Themespress\",\"description\":\"Des tutoriels et ressources WordPress\",\"inLanguage\":\"en-US\",\"publisher\":{\"@id\":\"https:\\\/\\\/themespress.ca\\\/en\\\/#organization\"}}]}\n\t\t<\/script>\n\t\t<!-- All in One SEO -->\n\n","aioseo_head_json":{"title":"Create a Query With a WordPress Multisite Network - Themespress","description":"Share the post \"Create a Query With a WordPress Multisite Network\" Facebook LinkedIn Twitter Partager... E-mail Ajouter aux favoris Bluesky In this tutorial we will show how to create a query that will pull a specific website\u2019s post type within the multisite network. In order to attain this, we will use the switch_to_blog(); function and","canonical_url":"https:\/\/themespress.ca\/en\/query-wordpress-multisite-network\/","robots":"max-image-preview:large","keywords":"","webmasterTools":{"miscellaneous":""},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"BlogPosting","@id":"https:\/\/themespress.ca\/en\/query-wordpress-multisite-network\/#blogposting","name":"Create a Query With a WordPress Multisite Network - Themespress","headline":"Create a Query With a WordPress Multisite Network","author":{"@id":"https:\/\/themespress.ca\/en\/author\/daniel\/#author"},"publisher":{"@id":"https:\/\/themespress.ca\/en\/#organization"},"image":{"@type":"ImageObject","url":"https:\/\/themespress.ca\/wp-content\/uploads\/2021\/02\/Creer-une-requete-dans-un-multisite-WordPress.jpg","width":1920,"height":1184,"caption":"Cr\u00e9er une requ\u00eate dans un multisite WordPress"},"datePublished":"2021-02-20T10:15:27-05:00","dateModified":"2021-07-07T06:20:50-04:00","inLanguage":"en-US","mainEntityOfPage":{"@id":"https:\/\/themespress.ca\/en\/query-wordpress-multisite-network\/#webpage"},"isPartOf":{"@id":"https:\/\/themespress.ca\/en\/query-wordpress-multisite-network\/#webpage"},"articleSection":"Tutorials, Optional"},{"@type":"BreadcrumbList","@id":"https:\/\/themespress.ca\/en\/query-wordpress-multisite-network\/#breadcrumblist","itemListElement":[{"@type":"ListItem","@id":"https:\/\/themespress.ca\/en\/#listItem","position":1,"name":"Accueil","item":"https:\/\/themespress.ca\/en\/","nextItem":{"@type":"ListItem","@id":"https:\/\/themespress.ca\/en\/categorie\/tutorials\/#listItem","name":"Tutorials"}},{"@type":"ListItem","@id":"https:\/\/themespress.ca\/en\/categorie\/tutorials\/#listItem","position":2,"name":"Tutorials","item":"https:\/\/themespress.ca\/en\/categorie\/tutorials\/","nextItem":{"@type":"ListItem","@id":"https:\/\/themespress.ca\/en\/query-wordpress-multisite-network\/#listItem","name":"Create a Query With a WordPress Multisite Network"},"previousItem":{"@type":"ListItem","@id":"https:\/\/themespress.ca\/en\/#listItem","name":"Accueil"}},{"@type":"ListItem","@id":"https:\/\/themespress.ca\/en\/query-wordpress-multisite-network\/#listItem","position":3,"name":"Create a Query With a WordPress Multisite Network","previousItem":{"@type":"ListItem","@id":"https:\/\/themespress.ca\/en\/categorie\/tutorials\/#listItem","name":"Tutorials"}}]},{"@type":"Organization","@id":"https:\/\/themespress.ca\/en\/#organization","name":"Themespress","description":"Des tutoriels et ressources WordPress","url":"https:\/\/themespress.ca\/en\/"},{"@type":"Person","@id":"https:\/\/themespress.ca\/en\/author\/daniel\/#author","url":"https:\/\/themespress.ca\/en\/author\/daniel\/","name":"Daniel","image":{"@type":"ImageObject","@id":"https:\/\/themespress.ca\/en\/query-wordpress-multisite-network\/#authorImage","url":"https:\/\/secure.gravatar.com\/avatar\/93cd2188e40b3289d305e88acb676eb8b84078e50e06f4eb38a0152903b34c9d?s=96&d=mm&r=g","width":96,"height":96,"caption":"Daniel"}},{"@type":"WebPage","@id":"https:\/\/themespress.ca\/en\/query-wordpress-multisite-network\/#webpage","url":"https:\/\/themespress.ca\/en\/query-wordpress-multisite-network\/","name":"Create a Query With a WordPress Multisite Network - Themespress","description":"Share the post \"Create a Query With a WordPress Multisite Network\" Facebook LinkedIn Twitter Partager... E-mail Ajouter aux favoris Bluesky In this tutorial we will show how to create a query that will pull a specific website\u2019s post type within the multisite network. In order to attain this, we will use the switch_to_blog(); function and","inLanguage":"en-US","isPartOf":{"@id":"https:\/\/themespress.ca\/en\/#website"},"breadcrumb":{"@id":"https:\/\/themespress.ca\/en\/query-wordpress-multisite-network\/#breadcrumblist"},"author":{"@id":"https:\/\/themespress.ca\/en\/author\/daniel\/#author"},"creator":{"@id":"https:\/\/themespress.ca\/en\/author\/daniel\/#author"},"image":{"@type":"ImageObject","url":"https:\/\/themespress.ca\/wp-content\/uploads\/2021\/02\/Creer-une-requete-dans-un-multisite-WordPress.jpg","@id":"https:\/\/themespress.ca\/en\/query-wordpress-multisite-network\/#mainImage","width":1920,"height":1184,"caption":"Cr\u00e9er une requ\u00eate dans un multisite WordPress"},"primaryImageOfPage":{"@id":"https:\/\/themespress.ca\/en\/query-wordpress-multisite-network\/#mainImage"},"datePublished":"2021-02-20T10:15:27-05:00","dateModified":"2021-07-07T06:20:50-04:00"},{"@type":"WebSite","@id":"https:\/\/themespress.ca\/en\/#website","url":"https:\/\/themespress.ca\/en\/","name":"Themespress","description":"Des tutoriels et ressources WordPress","inLanguage":"en-US","publisher":{"@id":"https:\/\/themespress.ca\/en\/#organization"}}]},"og:locale":"en_US","og:site_name":"Themespress - Des tutoriels et ressources WordPress","og:type":"article","og:title":"Create a Query With a WordPress Multisite Network - Themespress","og:description":"Share the post &quot;Create a Query With a WordPress Multisite Network&quot; Facebook LinkedIn Twitter Partager... E-mail Ajouter aux favoris Bluesky In this tutorial we will show how to create a query that will pull a specific website\u2019s post type within the multisite network. In order to attain this, we will use the switch_to_blog(); function and","og:url":"https:\/\/themespress.ca\/en\/query-wordpress-multisite-network\/","article:published_time":"2021-02-20T15:15:27-05:00","article:modified_time":"2021-07-07T10:20:50-04:00","twitter:card":"summary","twitter:title":"Create a Query With a WordPress Multisite Network - Themespress","twitter:description":"Share the post &quot;Create a Query With a WordPress Multisite Network&quot; Facebook LinkedIn Twitter Partager... E-mail Ajouter aux favoris Bluesky In this tutorial we will show how to create a query that will pull a specific website\u2019s post type within the multisite network. In order to attain this, we will use the switch_to_blog(); function and"},"aioseo_meta_data":{"post_id":"4191","title":null,"description":null,"keywords":[],"keyphrases":{"focus":[],"additional":[]},"primary_term":null,"canonical_url":null,"og_title":null,"og_description":null,"og_object_type":"default","og_image_type":"default","og_image_url":null,"og_image_width":null,"og_image_height":null,"og_image_custom_url":null,"og_image_custom_fields":null,"og_video":"","og_custom_url":null,"og_article_section":null,"og_article_tags":[],"twitter_use_og":false,"twitter_card":"default","twitter_image_type":"default","twitter_image_url":null,"twitter_image_custom_url":null,"twitter_image_custom_fields":null,"twitter_title":null,"twitter_description":null,"schema":{"blockGraphs":[],"customGraphs":[],"default":{"data":{"Article":[],"Course":[],"Dataset":[],"FAQPage":[],"Movie":[],"Person":[],"Product":[],"ProductReview":[],"Car":[],"Recipe":[],"Service":[],"SoftwareApplication":[],"WebPage":[]},"graphName":"","isEnabled":true},"graphs":[],"defaultGraph":"Article","defaultPostTypeGraph":""},"schema_type":"default","schema_type_options":"{\"article\":{\"articleType\":\"BlogPosting\"},\"course\":{\"name\":\"\",\"description\":\"\",\"provider\":\"\"},\"faq\":{\"pages\":[]},\"product\":{\"reviews\":[]},\"recipe\":{\"ingredients\":[],\"instructions\":[],\"keywords\":[]},\"software\":{\"reviews\":[],\"operatingSystems\":[]},\"webPage\":{\"webPageType\":\"WebPage\"}}","pillar_content":false,"robots_default":true,"robots_noindex":false,"robots_noarchive":false,"robots_nosnippet":false,"robots_nofollow":false,"robots_noimageindex":false,"robots_noodp":false,"robots_notranslate":false,"robots_max_snippet":"-1","robots_max_videopreview":"-1","robots_max_imagepreview":"large","priority":null,"frequency":"default","local_seo":{"locations":{"business":{"name":"","businessType":"","image":"","areaServed":"","urls":{"website":"","aboutPage":"","contactPage":""},"address":{"streetLine1":"","streetLine2":"","zipCode":"","city":"","state":"","country":"","addressFormat":"#streetLineOne\\n#streetLineTwo\\n#city, #state #zipCode"},"contact":{"email":"","phone":"","phoneFormatted":"","fax":"","faxFormatted":""},"ids":{"vat":"","tax":"","chamberOfCommerce":""},"payment":{"priceRange":"","currenciesAccepted":"","methods":""}}},"openingHours":{"useDefaults":true,"show":false,"alwaysOpen":false,"use24hFormat":false,"timezone":"","labels":{"closed":"","alwaysOpen":""},"days":{"monday":{"open24h":false,"closed":false,"openTime":"09:00","closeTime":"17:00"},"tuesday":{"open24h":false,"closed":false,"openTime":"09:00","closeTime":"17:00"},"wednesday":{"open24h":false,"closed":false,"openTime":"09:00","closeTime":"17:00"},"thursday":{"open24h":false,"closed":false,"openTime":"09:00","closeTime":"17:00"},"friday":{"open24h":false,"closed":false,"openTime":"09:00","closeTime":"17:00"},"saturday":{"open24h":false,"closed":false,"openTime":"09:00","closeTime":"17:00"},"sunday":{"open24h":false,"closed":false,"openTime":"09:00","closeTime":"17:00"}},"closedLabel":"","open24h":false,"open24hLabel":"","open247":false,"twoSets":false,"hours":[]},"businessInfo":{"name":"","urls":{"website":"","aboutPage":"","contactPage":""},"address":{"line1":"","line2":"","zip":"","city":"","state":"","country":""},"contact":{"email":"","phone":"","fax":""},"ids":{"vatID":"","taxID":"","chamberID":""},"payment":{"priceIndication":"","currenciesAccepted":"","methodsAccepted":""},"areaServed":""}},"breadcrumb_settings":null,"limit_modified_date":false,"ai":null,"created":"2021-03-06 14:19:45","updated":"2025-06-07 20:39:06","seo_analyzer_scan_date":null},"aioseo_breadcrumb":"<div class=\"aioseo-breadcrumbs\"><span class=\"aioseo-breadcrumb\">\n\t\t\t<a href=\"https:\/\/themespress.ca\/en\/\" title=\"Accueil\">Accueil<\/a>\n\t\t<\/span><span class=\"aioseo-breadcrumb-separator\">&raquo;<\/span><span class=\"aioseo-breadcrumb\">\n\t\t\t<a href=\"https:\/\/themespress.ca\/en\/categorie\/tutorials\/\" title=\"Tutorials\">Tutorials<\/a>\n\t\t<\/span><span class=\"aioseo-breadcrumb-separator\">&raquo;<\/span><span class=\"aioseo-breadcrumb\">\n\t\t\tCreate a Query With a WordPress Multisite Network\n\t\t<\/span><\/div>","aioseo_breadcrumb_json":[{"label":"Accueil","link":"https:\/\/themespress.ca\/en\/"},{"label":"Tutorials","link":"https:\/\/themespress.ca\/en\/categorie\/tutorials\/"},{"label":"Create a Query With a WordPress Multisite Network","link":"https:\/\/themespress.ca\/en\/query-wordpress-multisite-network\/"}],"_links":{"self":[{"href":"https:\/\/themespress.ca\/en\/wp-json\/wp\/v2\/posts\/4191","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/themespress.ca\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/themespress.ca\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/themespress.ca\/en\/wp-json\/wp\/v2\/users\/81"}],"replies":[{"embeddable":true,"href":"https:\/\/themespress.ca\/en\/wp-json\/wp\/v2\/comments?post=4191"}],"version-history":[{"count":0,"href":"https:\/\/themespress.ca\/en\/wp-json\/wp\/v2\/posts\/4191\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/themespress.ca\/en\/wp-json\/wp\/v2\/media\/4026"}],"wp:attachment":[{"href":"https:\/\/themespress.ca\/en\/wp-json\/wp\/v2\/media?parent=4191"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/themespress.ca\/en\/wp-json\/wp\/v2\/categories?post=4191"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/themespress.ca\/en\/wp-json\/wp\/v2\/tags?post=4191"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}