Pretty Permalink Breaks sidebar PHP
-
I’m updating a legacy site for a client. It was a very old wordpress from 2009. A lot of the code is mixed with static and dynamic.
The sidebar changes with different pages depending on the page template.
This is the current side bar code
<div id=”sidebar”>
<?php
$pageID = $_GET[“page_id”];
$sidebar = get_post_meta($pageID, ‘sidebar’, true);if(is_single()){
$sidebar = ‘Blog’;
}if(!dynamic_sidebar($sidebar)){
echo “Could not find sidebar”;
}?>
</div>When I change the permalinks to prettypermalinks it breaks the sidebar and get this error “Could not find sidebar”
When I change the permalinks back to default it works again.
Does anyone have any idea of the issue? Thanks
- The topic ‘Pretty Permalink Breaks sidebar PHP’ is closed to new replies.