diff --git a/system/includes/functions.php b/system/includes/functions.php
index bc5bc63..24565e3 100644
--- a/system/includes/functions.php
+++ b/system/includes/functions.php
@@ -1621,7 +1621,7 @@ EOF;
function menu($custom = null)
{
$menu = config('blog.menu');
- $req = $_SERVER['REQUEST_URI'];
+ $req = strtok($_SERVER["REQUEST_URI"],'?');
if (!empty($menu)) {
@@ -1649,24 +1649,20 @@ function menu($custom = null)
if (isset($anc[0]) && isset($anc[1])) {
if (stripos(rtrim($anc[1], '/') . '/', site_url()) !== false) {
- $id = substr($link, strrpos($link, '/') + 1);
- $file = 'content/static/' . $id . '.md';
- if (file_exists($file)) {
- if (stripos($req, $id) !== false) {
- echo '
' . $anc[0] . '';
+ if (rtrim($anc[1], '/') . '/' == site_url()) {
+ if ($req == site_path() . '/' || stripos($req, site_path() . '/?page') !== false) {
+ echo '' . config('breadcrumb.home') . '';
} else {
- echo '' . $anc[0] . '';
+ echo '' . config('breadcrumb.home') . '';
}
- } else {
- if (rtrim($anc[1], '/') . '/' == site_url()) {
- if ($req == site_path() . '/') {
- echo '' . config('breadcrumb.home') . '';
- } else {
- echo '' . config('breadcrumb.home') . '';
- }
- } else {
+ } elseif (stripos($anc[1], $req) !== false) {
+ if ($req == site_path() . '/' || stripos($req, site_path() . '/?page') !== false) {
echo '' . $anc[0] . '';
+ } else {
+ echo '' . $anc[0] . '';
}
+ } else {
+ echo '' . $anc[0] . '';
}
} else {
echo '' . $anc[0] . '';