{"id":28841,"date":"2018-08-20T11:00:24","date_gmt":"2018-08-20T11:00:24","guid":{"rendered":"https:\/\/getflywheel.com\/?p=28841"},"modified":"2023-10-27T10:55:45","modified_gmt":"2023-10-27T15:55:45","slug":"show-different-sidebars-posts-pages-wordpress-how-to","status":"publish","type":"resource","link":"https:\/\/wpengine.com\/case-studies\/resources\/show-different-sidebars-posts-pages-wordpress-how-to\/","title":{"rendered":"How To Show Different Sidebars for Posts and Pages in WordPress"},"content":{"rendered":"\n<p>By default, WordPress shows the same sidebar on all posts and pages. But sometimes, you may want to display a completely different sidebar for your most important post or sidebar items related to an entire post category. If you\u2019ve ever wondered how to do that, you\u2019re in luck!<\/p>\n\n\n\n<p>In this article, we&#8217;ll show you how to create unique sidebars for different posts or pages, both manually and with WordPress plugins. But first, let\u2019s talk more about why you might want to do this.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Why you might want different sidebars<\/h2>\n\n\n\n<p>As stated earlier, if you have lots of categories in your blog, you may be tempted to have a sidebar with similar offers, ads, or products to that topic. Or maybe you want to talk about your business in an \u201cAbout Us\u201d sidebar, tailored to the audience of each page.<\/p>\n\n\n\n<p>In these types of situations, you\u2019ll want to have a unique sidebar. There are two ways you can create one: manually by developing your own or with a WordPress plugin.<\/p>\n\n\n\n<p>Let&#8217;s cover the manual way first.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">How to manually create a new WordPress sidebar<\/h2>\n\n\n\n<p>To manually create a new sidebar, ideally you should use a child theme in a local environment. We&#8217;ve already created one for the <a href=\"https:\/\/wordpress.org\/themes\/twentyseventeen\/?utm_source=layout&amp;utm_medium=resources&amp;utm_campaign=different-sidebars-layout&amp;utm_content=2017-wordpress-theme\" target=\"_blank\" rel=\"noopener\">twentyseventeen theme<\/a>, but you can follow the same process for any theme.<\/p>\n\n\n\n<p>First, find the file where the sidebar is registered in your theme. Typically it&#8217;s the functions.php file, but it may vary depending on your theme.<\/p>\n\n\n\n<p>Open the file and locate the function for the sidebar code. It will generally consist of <code>register_sidebar<\/code> and the full function might look something like this:<\/p>\n\n\n<p>[php]<\/p>\n<p>function twentyseventeen_widgets_init() {<\/p>\n<p>register_sidebar(<\/p>\n<p>array(<\/p>\n<p>&#8216;name&#8217; \u00a0\u00a0\u00a0\u00a0\u00a0 =&gt; __( &#8216;Blog Sidebar&#8217;, &#8216;twentyseventeen&#8217; ),<\/p>\n<p>&#8216;id&#8217; \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 =&gt; &#8216;sidebar-1&#8217;,<\/p>\n<p>&#8216;description&#8217; \u00a0\u00a0=&gt; __( &#8216;Add widgets here to appear in your sidebar on blog posts and archive pages.&#8217;, &#8216;twentyseventeen&#8217; ),<\/p>\n<p>&#8216;before_widget&#8217; =&gt; &#8216;&lt;section id=&#8221;%1$s&#8221; class=&#8221;widget %2$s&#8221;&gt;&#8217;,<\/p>\n<p>&#8216;after_widget&#8217; \u00a0=&gt; &#8216;&lt;\/section&gt;&#8217;,<\/p>\n<p>&#8216;before_title&#8217; \u00a0=&gt; &#8216;&lt;h2 class=&#8221;widget-title&#8221;&gt;&#8217;,<\/p>\n<p>&#8216;after_title&#8217; \u00a0\u00a0=&gt; &#8216;&lt;\/h2&gt;&#8217;,<\/p>\n<p>)<\/p>\n<p>);<\/p>\n<p>register_sidebar(<\/p>\n<p>array(<\/p>\n<p>&#8216;name&#8217; \u00a0\u00a0\u00a0\u00a0\u00a0 =&gt; __( &#8216;Footer 1&#8217;, &#8216;twentyseventeen&#8217; ),<\/p>\n<p>&#8216;id&#8217; \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 =&gt; &#8216;sidebar-2&#8217;,<\/p>\n<p>&#8216;description&#8217; \u00a0\u00a0=&gt; __( &#8216;Add widgets here to appear in your footer.&#8217;, &#8216;twentyseventeen&#8217; ),<\/p>\n<p>&#8216;before_widget&#8217; =&gt; &#8216;&lt;section id=&#8221;%1$s&#8221; class=&#8221;widget %2$s&#8221;&gt;&#8217;,<\/p>\n<p>&#8216;after_widget&#8217; \u00a0=&gt; &#8216;&lt;\/section&gt;&#8217;,<\/p>\n<p>&#8216;before_title&#8217; \u00a0=&gt; &#8216;&lt;h2 class=&#8221;widget-title&#8221;&gt;&#8217;,<\/p>\n<p>&#8216;after_title&#8217; \u00a0\u00a0=&gt; &#8216;&lt;\/h2&gt;&#8217;,<\/p>\n<p>)<\/p>\n<p>);<\/p>\n<p>register_sidebar(<\/p>\n<p>array(<\/p>\n<p>&#8216;name&#8217; \u00a0 \u00a0\u00a0\u00a0=&gt; __( &#8216;Footer 2&#8217;, &#8216;twentyseventeen&#8217; ),<\/p>\n<p>&#8216;id&#8217; \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 =&gt; &#8216;sidebar-3&#8217;,<\/p>\n<p>&#8216;description&#8217; \u00a0\u00a0=&gt; __( &#8216;Add widgets here to appear in your footer.&#8217;, &#8216;twentyseventeen&#8217; ),<\/p>\n<p>&#8216;before_widget&#8217; =&gt; &#8216;&lt;section id=&#8221;%1$s&#8221; class=&#8221;widget %2$s&#8221;&gt;&#8217;,<\/p>\n<p>&#8216;after_widget&#8217; \u00a0=&gt; &#8216;&lt;\/section&gt;&#8217;,<\/p>\n<p>&#8216;before_title&#8217; \u00a0=&gt; &#8216;&lt;h2 class=&#8221;widget-title&#8221;&gt;&#8217;,<\/p>\n<p>&#8216;after_title&#8217; \u00a0\u00a0=&gt; &#8216;&lt;\/h2&gt;&#8217;,<\/p>\n<p>)<\/p>\n<p>);<\/p>\n<p>}<\/p>\n<p>add_action( &#8216;widgets_init&#8217;, &#8216;twentyseventeen_widgets_init&#8217; );<\/p>\n<p>[\/php]<\/p>\n\n\n\n<p>Now copy the entire function and create a functions.php file in your child theme (if you don&#8217;t have it already) and paste the code. Make sure to change the function name.<\/p>\n\n\n\n<p>Depending on how many additional sidebars you need to create, you can simply replicate the same code and assign a unique id to each sidebar. You should also change the name and description to make each one unique. Here we&#8217;ve created two new sidebars:<\/p>\n\n\n<p>[php]<\/p>\n<p>function twentyseventeen_new_widgets_init() {<\/p>\n<p>register_sidebar(<\/p>\n<p>array(<\/p>\n<p>&#8216;name&#8217; \u00a0\u00a0\u00a0\u00a0\u00a0 =&gt; __( &#8216;WordPress Sidebar&#8217;, &#8216;twentyseventeen&#8217; ),<\/p>\n<p>&#8216;id&#8217; \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 =&gt; &#8216;sidebar-4&#8217;,<\/p>\n<p>&#8216;description&#8217; \u00a0\u00a0=&gt; __( &#8216;Add widgets here to appear in your sidebar on wordpress related blog posts.&#8217;, &#8216;twentyseventeen&#8217; ),<\/p>\n<p>&#8216;before_widget&#8217; =&gt; &#8216;&lt;section id=&#8221;%1$s&#8221; class=&#8221;widget %2$s&#8221;&gt;&#8217;,<\/p>\n<p>&#8216;after_widget&#8217; \u00a0=&gt; &#8216;&lt;\/section&gt;&#8217;,<\/p>\n<p>&#8216;before_title&#8217; \u00a0=&gt; &#8216;&lt;h2 class=&#8221;widget-title&#8221;&gt;&#8217;,<\/p>\n<p>&#8216;after_title&#8217; \u00a0\u00a0=&gt; &#8216;&lt;\/h2&gt;&#8217;,<\/p>\n<p>)<\/p>\n<p>);<\/p>\n<p>register_sidebar(<\/p>\n<p>array(<\/p>\n<p>&#8216;name&#8217; \u00a0\u00a0\u00a0\u00a0\u00a0 =&gt; __( &#8216;Web Design Sidebar&#8217;, &#8216;twentyseventeen&#8217; ),<\/p>\n<p>&#8216;id&#8217; \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 =&gt; &#8216;sidebar-5&#8217;,<\/p>\n<p>&#8216;description&#8217; \u00a0\u00a0=&gt; __( &#8216;Add widgets here to appear in your sidebar on web design related blog posts.&#8217;, &#8216;twentyseventeen&#8217; ),<\/p>\n<p>&#8216;before_widget&#8217; =&gt; &#8216;&lt;section id=&#8221;%1$s&#8221; class=&#8221;widget %2$s&#8221;&gt;&#8217;,<\/p>\n<p>&#8216;after_widget&#8217; \u00a0=&gt; &#8216;&lt;\/section&gt;&#8217;,<\/p>\n<p>&#8216;before_title&#8217; \u00a0=&gt; &#8216;&lt;h2 class=&#8221;widget-title&#8221;&gt;&#8217;,<\/p>\n<p>&#8216;after_title&#8217; \u00a0\u00a0=&gt; &#8216;&lt;\/h2&gt;&#8217;,<\/p>\n<p>)<\/p>\n<p>);<\/p>\n<p>}<\/p>\n<p>add_action( &#8216;widgets_init&#8217;, &#8216;twentyseventeen_new_widgets_init&#8217; );<\/p>\n<p>[\/php]<\/p>\n\n\n\n<p>The new sidebars are ready now; If you check the widgets section, it will show two new widget areas. We&#8217;ve added a simple text widget to each sidebar to make them recognizable.<\/p>\n\n\n\n<figure class=\"wp-block-image aligncenter\"><img decoding=\"async\" src=\"https:\/\/getflywheel-images.s3.us-east-2.amazonaws.com\/uploads\/2018\/08\/different-sidebar-wordpress-1.jpg\" alt=\"wordpress dashboard wordpress widgets and content selector and different sidebar with multiple footers\" class=\"wp-image-28853\" \/><\/figure>\n\n\n\n<p>Once you have your sidebars created, it\u2019s time to assign the location. We\u2019re looking to replace the existing right sidebar, so you need to find the file where it\u2019s located.<\/p>\n\n\n\n<p>For this instance, it&#8217;s in <code>sidebar.php<\/code>. Copy the file from the parent theme and paste it into your child theme.<\/p>\n\n\n\n<p>If you check the file, it&#8217;s calling <code>sidebar-1<\/code>, which is the id of the main right sidebar.<\/p>\n\n\n<p>[php]<\/p>\n<p>&lt;aside id=&#8221;secondary&#8221; class=&#8221;widget-area&#8221; role=&#8221;complementary&#8221; aria-label=&#8221;&lt;?php esc_attr_e( &#8216;Blog Sidebar&#8217;, &#8216;twentyseventeen&#8217; ); ?&gt;&#8221;&gt;<\/p>\n<p>&lt;?php dynamic_sidebar( &#8216;sidebar-1&#8217; ); ?&gt;<\/p>\n<p>&lt;\/aside&gt;<\/p>\n<p>[\/php]<\/p>\n\n\n\n<p>Now, we&#8217;ll create one sidebar for my web design category and another for my WordPress category. This can be achieved in two different ways: one is a template-driven approach and the other is a category-driven approach.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Template-driven approach<\/h3>\n\n\n\n<p>In this approach, you have to create different templates depending on your requirements. For this example, single.php is responsible for single posts, so you can copy and paste the file in your child theme. Rename the file accordingly, like <code>wordpress-post.php<\/code>, and add a template name as well.<\/p>\n\n\n<p>[php]<\/p>\n<p>\/* Template Name: WordPress Sidebar<\/p>\n<p>* Template Post Type: post*\/<\/p>\n<p>[\/php]<\/p>\n\n\n\n<p>Likewise, we have created another template named <code>webdesign-post.php<\/code>.<\/p>\n\n\n\n<figure class=\"wp-block-image aligncenter\"><img decoding=\"async\" src=\"https:\/\/getflywheel-images.s3.us-east-2.amazonaws.com\/uploads\/2018\/08\/different-sidebar-wordpress-2.jpg\" alt=\"wordpress twentyseventeen theme with wordpress-post and webdesign-post in local files\" class=\"wp-image-28854\" \/><\/figure>\n\n\n\n<p>Now, go back to the child theme&#8217;s <code>sidebar.php<\/code> file and add a simple condition to check which template is in use. For this, we\u2019ll use the<a href=\"https:\/\/developer.wordpress.org\/reference\/functions\/is_page_template\/?utm_source=layout&amp;utm_medium=resources&amp;utm_campaign=different-sidebars-layout&amp;utm_content=is-page-template\" target=\"_blank\" rel=\"noopener noreferrer\"><code>is_page_template()<\/code><\/a> function.<\/p>\n\n\n\n<p>The code is self-explanatory. It checks which template is in use and sets the sidebar accordingly. If none of the conditions are fulfilled, it will use the default sidebar.<\/p>\n\n\n<p>[php]<\/p>\n<p>&lt;?php<\/p>\n<p>if ( is_page_template(&#8216;wordpress-post.php&#8217;) ) {<\/p>\n<p>dynamic_sidebar( &#8216;sidebar-4&#8217; );<\/p>\n<p>}elseif ( is_page_template(&#8216;webdesign-post.php&#8217;) ){<\/p>\n<p>dynamic_sidebar( &#8216;sidebar-5&#8217; );<\/p>\n<p>}else{<\/p>\n<p>dynamic_sidebar( &#8216;sidebar-1&#8217; );<\/p>\n<p>}<\/p>\n<p>?&gt;<\/p>\n<p>[\/php]<\/p>\n\n\n\n<p>Now let&#8217;s create a new post and assign one of the templates we just created.<\/p>\n\n\n\n<figure class=\"wp-block-image aligncenter\"><img decoding=\"async\" src=\"https:\/\/getflywheel-images.s3.us-east-2.amazonaws.com\/uploads\/2018\/08\/different-sidebar-wordpress-3.jpg\" alt=\"edit wordpress post attributes template with different sidebar\" class=\"wp-image-28855\" \/><\/figure>\n\n\n\n<p>You will see I\u2019ve selected the WordPress sidebar for this particular post.<\/p>\n\n\n\n<figure class=\"wp-block-image aligncenter\"><img decoding=\"async\" src=\"https:\/\/getflywheel-images.s3.us-east-2.amazonaws.com\/uploads\/2018\/08\/different-sidebar-wordpress-4.jpg\" alt=\"wordpress preview of live post with different sidebar \" class=\"wp-image-28856\" \/><\/figure>\n\n\n\n<h3 class=\"wp-block-heading\">Category-driven approach<\/h3>\n\n\n\n<p>For this example (changing the sidebar based on post categories), a category-driven approach will work better than the template-driven approach. To do this, you\u2019ll need to adjust the condition in <code>sidebar.php<\/code> based on the category instead of template using<a href=\"https:\/\/developer.wordpress.org\/reference\/functions\/in_category\/?utm_source=layout&amp;utm_medium=resources&amp;utm_campaign=different-sidebars-layout&amp;utm_content=wp-dev-functions\" target=\"_blank\" rel=\"noopener noreferrer\"><code>in_category()<\/code><\/a> function.<\/p>\n\n\n<p>[php]<\/p>\n<p>&lt;?php<\/p>\n<p>if ( in_category(&#8216;wordpress&#8217;) ) {<\/p>\n<p>dynamic_sidebar( &#8216;sidebar-4&#8217; );<\/p>\n<p>}elseif ( in_category(&#8216;web-design&#8217;) ){<\/p>\n<p>dynamic_sidebar( &#8216;sidebar-5&#8217; );<\/p>\n<p>}else{<\/p>\n<p>dynamic_sidebar( &#8216;sidebar-1&#8217; );<\/p>\n<p>}<\/p>\n<p>?&gt;<\/p>\n<p>[\/php]<\/p>\n\n\n\n<p>Now if you edit or create a new post, just add your desired category. It\u2019ll display the sidebar accordingly, so there\u2019s no need to choose any template! Here we\u2019ve chosen web design as my post category, so the web design sidebar will appear.<\/p>\n\n\n\n<figure class=\"wp-block-image aligncenter\"><img decoding=\"async\" src=\"https:\/\/getflywheel-images.s3.us-east-2.amazonaws.com\/uploads\/2018\/08\/different-sidebar-wordpress-5.jpg\" alt=\"wordpress sidebar update based on categories web design selected\" class=\"wp-image-28857\" \/><\/figure>\n\n\n\n<p>Basically, you just need to adjust the sidebar.php condition according to your specific requirements.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">How to create custom sidebars with WordPress plugins<\/h2>\n\n\n\n<p>If you\u2019re having trouble creating sidebars manually, you can try some handy WordPress plugins that allow you to easily create them!<\/p>\n\n\n\n<p>One such plugin is<a href=\"https:\/\/wordpress.org\/plugins\/content-aware-sidebars\/?utm_source=layout&amp;utm_medium=resources&amp;utm_campaign=different-sidebars-layout&amp;utm_content=content-aware-sidebar-plugin\" target=\"_blank\" rel=\"noopener noreferrer\"> Content Aware Sidebars<\/a>. It\u2019s a simple plugin that lets you dynamically create sidebars on individual pages, posts, categories, etc.<\/p>\n\n\n\n<p>Once installed, you will see a <strong>Sidebars<\/strong> menu in the admin panel.<\/p>\n\n\n\n<p><strong>Sidebars &gt; Add New<\/strong><\/p>\n\n\n\n<figure class=\"wp-block-image aligncenter\"><img decoding=\"async\" src=\"https:\/\/getflywheel-images.s3.us-east-2.amazonaws.com\/uploads\/2018\/08\/different-sidebar-wordpress-6.jpg\" alt=\"wordpress sidebars plugin option add new sidebar\" class=\"wp-image-28858\" \/><\/figure>\n\n\n\n<p>First, add a name to your sidebar. You can then set display conditions from the <strong>Sidebar Conditions<\/strong> dropdown. A sidebar can have multiple conditions like pages, posts, categories, author, etc.<\/p>\n\n\n\n<figure class=\"wp-block-image aligncenter\"><img decoding=\"async\" src=\"https:\/\/getflywheel-images.s3.us-east-2.amazonaws.com\/uploads\/2018\/08\/different-sidebar-wordpress-7.jpg\" alt=\"set my sidebar suggestions different sidebar for wordpress posts and pages\" class=\"wp-image-28859\" \/><\/figure>\n\n\n\n<p>You can schedule your sidebar from the schedule tab, and alter HTML tags in the design tab.<\/p>\n\n\n\n<p>You will see an <strong>Options<\/strong> box on the right side. From there, you can set the location and rules of your new sidebar. You can also perform actions, such as creating a shortcode of your sidebar.<\/p>\n\n\n\n<p>Once your sidebar is published, you can access it from the <strong>Appearance &gt; Widgets<\/strong> section.<\/p>\n\n\n\n<figure class=\"wp-block-image aligncenter\"><img decoding=\"async\" src=\"https:\/\/getflywheel-images.s3.us-east-2.amazonaws.com\/uploads\/2018\/08\/different-sidebar-wordpress-8.jpg\" alt=\"in appearance widgets edit my sidebar options to get a different wordpress sidebar for posts and pages\" class=\"wp-image-28860\" \/><\/figure>\n\n\n\n<p>This new sidebar will appear on pages and posts automatically, as per your settings.<\/p>\n\n\n\n<p>The plugin also allows you to select sidebars when editing each post or page, regardless of your initial settings.<\/p>\n\n\n\n<p>Within a post or page, you\u2019ll see a <strong>Sidebars &#8211; Quick Select<\/strong> panel on the right side that will show you all the existing sidebars. From there you can select your sidebar in the target location set previously in the initial settings.<\/p>\n\n\n\n<p>For instance, we had previously created <strong>My sidebar<\/strong> and the target location was <strong>Blog Sidebar<\/strong>, so in the <strong>Quick Select<\/strong> panel, <strong>My sidebar<\/strong>&nbsp;will be available for <strong>Blog Sidebar<\/strong>&nbsp;only.<\/p>\n\n\n\n<figure class=\"wp-block-image aligncenter\"><img decoding=\"async\" src=\"https:\/\/getflywheel-images.s3.us-east-2.amazonaws.com\/uploads\/2018\/08\/different-sidebar-wordpress-9.jpg\" alt=\"quick select blog sidebars for posts and pages to get different wordpress sidebar\" class=\"wp-image-28861\" \/><\/figure>\n\n\n\n<p>You can also create new sidebars, however, from the edit page section. Just type the name of your new sidebar and publish or update the page.<\/p>\n\n\n\n<figure class=\"wp-block-image aligncenter\"><img decoding=\"async\" src=\"https:\/\/getflywheel-images.s3.us-east-2.amazonaws.com\/uploads\/2018\/08\/different-sidebar-wordpress-10.jpg\" alt=\"new wordpress sidebar selected based on posts and pages\" class=\"wp-image-28862\" \/><\/figure>\n\n\n\n<p>If you create a new sidebar, you\u2019ll just need to activate it in the <strong>Appearance &gt; Widgets<\/strong> section.<\/p>\n\n\n\n<figure class=\"wp-block-image aligncenter\"><img decoding=\"async\" src=\"https:\/\/getflywheel-images.s3.us-east-2.amazonaws.com\/uploads\/2018\/08\/different-sidebar-wordpress-11.jpg\" alt=\"details on different sidebar for posts and pages in wordpress dashboard\" class=\"wp-image-28863\" \/><\/figure>\n\n\n\n<p>Note: You can also assign sidebars to your pages, but make sure your page template includes a sidebar. Without that, the sidebar will not be displayed, even if you set it in the edit page section.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Conclusion<\/h2>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/getflywheel-images.s3.us-east-2.amazonaws.com\/uploads\/2018\/08\/different-sidebars-posts-pages-wordpress-team-collaboration-in-article.png\" alt=\"Flywheelers teaming each other how to show different sidebar for posts and pages in wordpress \" class=\"wp-image-28845\" \/><\/figure>\n\n\n\n<p>You\u2019ve now seen two options for creating sidebars: manual development as well as with plugins. If you\u2019re not comfortable with codes, then using a plugin might be the best option for you, but if you have a specific requirement and don&#8217;t want to add an extra plugin to your site, then you should go for the manual way. The important thing is to understand your requirements and then choose your best option!<\/p>\n\n\n\n<p>You&#8217;ll also want to choose the best possible option when it comes to your <a href=\"https:\/\/wpengine.com\/wordpress-hosting\/\" target=\"_blank\" rel=\"noreferrer noopener\">WordPress hosting<\/a>, and for that, you&#8217;ll need look no further than WP Engine! Our platform provides a solid foundation for any WordPress site. Check out <a href=\"https:\/\/wpengine.com\/plans\/\" target=\"_blank\" rel=\"noreferrer noopener\">our plans<\/a> to learn more!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>By default, WordPress shows the same sidebar on all posts and pages. But sometimes, you may want to display a completely different sidebar for your most important post or sidebar items related to an entire post category. If you\u2019ve ever wondered how to do that, you\u2019re in luck! In this article, we&#8217;ll show you how<span class=\"tile__ellipses\">&hellip;<\/span><span class=\"tile__ellipses--animated\"><\/span><\/p>\n","protected":false},"author":1,"featured_media":140237,"template":"","resource-topic":[901],"resource-role":[1397,897],"resource-type":[916],"class_list":["post-28841","resource","type-resource","status-publish","has-post-thumbnail","hentry"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v20.9 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>How To Show Different Sidebars for Posts and Pages in WordPress<\/title>\n<meta name=\"description\" content=\"Looking for a new way to customize your website? Learn how to add different sidebars in WordPress manually or by using categories, templates, or plugins!\" \/>\n<meta name=\"robots\" content=\"noindex, follow\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"How To Show Different Sidebars for Posts and Pages in WordPress\" \/>\n<meta property=\"og:description\" content=\"Looking for a new way to customize your website? Learn how to add different sidebars in WordPress manually or by using categories, templates, or plugins!\" \/>\n<meta property=\"og:url\" content=\"https:\/\/wpengine.com\/case-studies\/resources\/show-different-sidebars-posts-pages-wordpress-how-to\/\" \/>\n<meta property=\"og:site_name\" content=\"WP Engine\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/wpengine\" \/>\n<meta property=\"article:modified_time\" content=\"2023-10-27T15:55:45+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/wpengine.com\/case-studies\/wp-content\/uploads\/2018\/08\/sidebars_1100x500.png\" \/>\n\t<meta property=\"og:image:width\" content=\"1100\" \/>\n\t<meta property=\"og:image:height\" content=\"500\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:site\" content=\"@wpengine\" \/>\n<meta name=\"twitter:label1\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data1\" content=\"9 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/wpengine.com\/case-studies\/resources\/show-different-sidebars-posts-pages-wordpress-how-to\/\",\"url\":\"https:\/\/wpengine.com\/case-studies\/resources\/show-different-sidebars-posts-pages-wordpress-how-to\/\",\"name\":\"How To Show Different Sidebars for Posts and Pages in WordPress\",\"isPartOf\":{\"@id\":\"https:\/\/wpengine.com\/case-studies\/#website\"},\"datePublished\":\"2018-08-20T11:00:24+00:00\",\"dateModified\":\"2023-10-27T15:55:45+00:00\",\"description\":\"Looking for a new way to customize your website? Learn how to add different sidebars in WordPress manually or by using categories, templates, or plugins!\",\"breadcrumb\":{\"@id\":\"https:\/\/wpengine.com\/case-studies\/resources\/show-different-sidebars-posts-pages-wordpress-how-to\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/wpengine.com\/case-studies\/resources\/show-different-sidebars-posts-pages-wordpress-how-to\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/wpengine.com\/case-studies\/resources\/show-different-sidebars-posts-pages-wordpress-how-to\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/wpengine.com\/case-studies\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Resources\",\"item\":\"https:\/\/wpengine.com\/case-studies\/resources\/\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"How To Show Different Sidebars for Posts and Pages in WordPress\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/wpengine.com\/case-studies\/#website\",\"url\":\"https:\/\/wpengine.com\/case-studies\/\",\"name\":\"WP Engine\",\"description\":\"Managed Hosting for WordPress\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/wpengine.com\/case-studies\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/wpengine.com\/case-studies\/#\/schema\/person\/f5301455463371a10d1fc290e9ad0085\",\"name\":\"WP Engine\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/wpengine.com\/case-studies\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/d8770fe9625ca7c4601f13d9d0ab86565a6dac8cd6a77bfe2ada6d83c6837870?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/d8770fe9625ca7c4601f13d9d0ab86565a6dac8cd6a77bfe2ada6d83c6837870?s=96&d=mm&r=g\",\"caption\":\"WP Engine\"},\"sameAs\":[\"https:\/\/wpengine.com\"]}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"How To Show Different Sidebars for Posts and Pages in WordPress","description":"Looking for a new way to customize your website? Learn how to add different sidebars in WordPress manually or by using categories, templates, or plugins!","robots":{"index":"noindex","follow":"follow"},"og_locale":"en_US","og_type":"article","og_title":"How To Show Different Sidebars for Posts and Pages in WordPress","og_description":"Looking for a new way to customize your website? Learn how to add different sidebars in WordPress manually or by using categories, templates, or plugins!","og_url":"https:\/\/wpengine.com\/case-studies\/resources\/show-different-sidebars-posts-pages-wordpress-how-to\/","og_site_name":"WP Engine","article_publisher":"https:\/\/www.facebook.com\/wpengine","article_modified_time":"2023-10-27T15:55:45+00:00","og_image":[{"width":1100,"height":500,"url":"https:\/\/wpengine.com\/case-studies\/wp-content\/uploads\/2018\/08\/sidebars_1100x500.png","type":"image\/png"}],"twitter_card":"summary_large_image","twitter_site":"@wpengine","twitter_misc":{"Est. reading time":"9 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/wpengine.com\/case-studies\/resources\/show-different-sidebars-posts-pages-wordpress-how-to\/","url":"https:\/\/wpengine.com\/case-studies\/resources\/show-different-sidebars-posts-pages-wordpress-how-to\/","name":"How To Show Different Sidebars for Posts and Pages in WordPress","isPartOf":{"@id":"https:\/\/wpengine.com\/case-studies\/#website"},"datePublished":"2018-08-20T11:00:24+00:00","dateModified":"2023-10-27T15:55:45+00:00","description":"Looking for a new way to customize your website? Learn how to add different sidebars in WordPress manually or by using categories, templates, or plugins!","breadcrumb":{"@id":"https:\/\/wpengine.com\/case-studies\/resources\/show-different-sidebars-posts-pages-wordpress-how-to\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/wpengine.com\/case-studies\/resources\/show-different-sidebars-posts-pages-wordpress-how-to\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/wpengine.com\/case-studies\/resources\/show-different-sidebars-posts-pages-wordpress-how-to\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/wpengine.com\/case-studies\/"},{"@type":"ListItem","position":2,"name":"Resources","item":"https:\/\/wpengine.com\/case-studies\/resources\/"},{"@type":"ListItem","position":3,"name":"How To Show Different Sidebars for Posts and Pages in WordPress"}]},{"@type":"WebSite","@id":"https:\/\/wpengine.com\/case-studies\/#website","url":"https:\/\/wpengine.com\/case-studies\/","name":"WP Engine","description":"Managed Hosting for WordPress","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/wpengine.com\/case-studies\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/wpengine.com\/case-studies\/#\/schema\/person\/f5301455463371a10d1fc290e9ad0085","name":"WP Engine","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/wpengine.com\/case-studies\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/d8770fe9625ca7c4601f13d9d0ab86565a6dac8cd6a77bfe2ada6d83c6837870?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/d8770fe9625ca7c4601f13d9d0ab86565a6dac8cd6a77bfe2ada6d83c6837870?s=96&d=mm&r=g","caption":"WP Engine"},"sameAs":["https:\/\/wpengine.com"]}]}},"acf":[],"grid_image_url":"https:\/\/wpengine.com\/case-studies\/wp-content\/uploads\/2018\/08\/sidebars_343x245.png","media-type":{"term_id":916,"name":"Article","slug":"article"},"role":"<strong>Roles:<\/strong> Designer, Freelancer","topic":"<strong>Topics:<\/strong> WordPress","_links":{"self":[{"href":"https:\/\/wpengine.com\/case-studies\/wp-json\/wp\/v2\/resource\/28841","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/wpengine.com\/case-studies\/wp-json\/wp\/v2\/resource"}],"about":[{"href":"https:\/\/wpengine.com\/case-studies\/wp-json\/wp\/v2\/types\/resource"}],"author":[{"embeddable":true,"href":"https:\/\/wpengine.com\/case-studies\/wp-json\/wp\/v2\/users\/1"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/wpengine.com\/case-studies\/wp-json\/wp\/v2\/media\/140237"}],"wp:attachment":[{"href":"https:\/\/wpengine.com\/case-studies\/wp-json\/wp\/v2\/media?parent=28841"}],"wp:term":[{"taxonomy":"resource-topic","embeddable":true,"href":"https:\/\/wpengine.com\/case-studies\/wp-json\/wp\/v2\/resource-topic?post=28841"},{"taxonomy":"resource-role","embeddable":true,"href":"https:\/\/wpengine.com\/case-studies\/wp-json\/wp\/v2\/resource-role?post=28841"},{"taxonomy":"resource-type","embeddable":true,"href":"https:\/\/wpengine.com\/case-studies\/wp-json\/wp\/v2\/resource-type?post=28841"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}