WordPress twentyfifteen loop in sidebar breaking static page content

Posted by on 21/06/2015

If you’re using the twentyfifteen theme in WordPress and trying to put a custom loop – for example to show a list of custom post types – in the sidebar, all the static pages will be broken and have their content replaced by posts that match the criteria of the sidebar loop.

The fix is to go into header.php and take the whole sidebar div, starting with:

<div id=”sidebar” class=”sidebar”>

Comments are closed.