I developed a new theme similar to Popeye theme(bludit-4.0.0-rc-3).
Now, I have a static homepage (mainpage.php) and a blog page (home.php).
I also have a search function plugin in both page. I want the search result to return the home.php structure/design instead of mainpage.php structure/design when initiated from the homepage (mainpage.php).
Finally, for context, I replaced the following
Code: Select all
<?php
// $WHERE_AM_I variable provides where the user is browsing
// If the user is watching a particular page the variable takes the value "page"
// If the user is watching the frontpage the variable takes the value "home"
// If the user is watching a particular category the variable takes the value "category"
if ($WHERE_AM_I == 'page') {
// Check if the page has a template
$template = $page->template();
if (($template) && file_exists(THEME_DIR_TEMPLATES.$template)) {
include(THEME_DIR_TEMPLATES.$template);
} else {
include(THEME_DIR_PHP.'page.php');
}
} else {
include(THEME_DIR_PHP.'home.php');
}
?>
Code: Select all
<?php if ($WHERE_AM_I == 'page') {
// Check if the page has a template
if ($page->slug() == "home") {
include(THEME_DIR_PHP.'home.php');
}
else {
include(THEME_DIR_PHP.'page.php');
}
}
else {
include(THEME_DIR_PHP.'mainpage.php');
} ?>
P.S. I want the search function to accurately retrieve content. I'd appreciate guide toward that as well.
Thank you