{"id":2363279,"date":"2011-10-24T11:08:53","date_gmt":"2011-10-24T11:08:53","guid":{"rendered":"https:\/\/wordpress.org\/support\/topic\/different-sidebar-widget-for-all-pages\/"},"modified":"2016-08-20T03:06:49","modified_gmt":"2016-08-20T03:06:49","slug":"different-sidebar-widget-for-all-pages","status":"closed","type":"topic","link":"https:\/\/wordpress.org\/support\/topic\/different-sidebar-widget-for-all-pages\/","title":{"rendered":"Different Sidebar widget for all pages"},"content":{"rendered":"<p>I&#8217;m looking for a way to use different widgets in the right sidebar for different pages. <\/p>\n<p>I tried using the custom field to choose sidebar template file (I have created a new template for the new sidebar) by inserting the following code in the pages.php file.<\/p>\n<pre><code>&lt;?php $sidebar = get_post_meta($post-&gt;ID, &quot;sidebar&quot;, true);\nget_sidebar($sidebar);\n?&gt;<\/code><\/pre>\n<p>However wordpress still uses the original sidebar.php file even though I till it to use another file.<\/p>\n<p>Is there some way to use different widgets in the sidebar for different pages?<\/p>\n","protected":false},"template":"","class_list":["post-2363279","topic","type-topic","status-closed","hentry"],"jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic\/2363279","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic"}],"about":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/types\/topic"}],"version-history":[{"count":0,"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic\/2363279\/revisions"}],"wp:attachment":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/media?parent=2363279"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}