mirror of
https://github.com/danpros/htmly.git
synced 2026-04-23 14:06:23 +05:30
Improve search page + 404
This commit is contained in:
parent
46ed4a6bbc
commit
9dd9f87cf5
6 changed files with 23 additions and 19 deletions
|
|
@ -812,7 +812,8 @@ function get_keyword($keyword, $page, $perpage)
|
|||
}
|
||||
}
|
||||
|
||||
return ($tmp) ? get_posts($tmp, $page, $perpage) : [];
|
||||
return ($tmp) ? get_posts($tmp, $page, $perpage) : [];
|
||||
|
||||
}
|
||||
|
||||
// Get related posts base on post tag.
|
||||
|
|
@ -899,8 +900,7 @@ function get_categorycount($var)
|
|||
|
||||
// Author string
|
||||
$str = explode('/', $replaced);
|
||||
$cat = $str[count($str) - 3];
|
||||
|
||||
$cat = '/blog/' . $str[count($str) - 3];
|
||||
if (stripos($cat, "$var") !== false) {
|
||||
$tmp[] = $v;
|
||||
}
|
||||
|
|
@ -1755,10 +1755,11 @@ function not_found()
|
|||
header($_SERVER["SERVER_PROTOCOL"] . " 404 Not Found");
|
||||
render('404', array(
|
||||
'title' => 'This page doesn\'t exist! - ' . blog_title(),
|
||||
'description' => '',
|
||||
'canonical' => false,
|
||||
'description' => '404 Not Found',
|
||||
'canonical' => site_url(),
|
||||
'breadcrumb' => '<a href="' . site_url() . '">' . config('breadcrumb.home') . '</a> » 404 Not Found',
|
||||
'bodyclass' => 'error-404',
|
||||
'is_notfound' => is_notfound(true),
|
||||
));
|
||||
die();
|
||||
}
|
||||
|
|
@ -2275,6 +2276,16 @@ function is_subpage($value = null)
|
|||
}
|
||||
}
|
||||
|
||||
// TRUE if the current page is 404 error page.
|
||||
function is_notfound($value = null)
|
||||
{
|
||||
if (!empty($value)) {
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
// Return blog title
|
||||
function blog_title()
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue