benjaminleist
Member
Posted 1 year ago #
Hey folks,
I got the following code in my sidebar.php:
if (is_page('home')) (!function_exists('dynamic_sidebar') || !dynamic_sidebar(2));
elseif (is_page('news')) (!function_exists('dynamic_sidebar') || !dynamic_sidebar(3));
else (!function_exists('dynamic_sidebar') || !dynamic_sidebar(1));
Sidebar 2 is displayed on the index page, sidebar 1 is displayed on all pages.
But on the news page the default sidebar (1) is displayed instead of sidebar 2. Why?
My index page shows a "page" (home) and my articles (the blog) is displayed on the page "news".
Sincerely,
Ben
benjaminleist
Member
Posted 1 year ago #
ryanhellyer
Member
Posted 1 year ago #
Sidebar 2 is displayed on the index page
By "index page" do you mean the WP Page labelled "Home"?
But on the news page the default sidebar (1) is displayed instead of sidebar 2. Why?
No idea, because (unless I've misread) according to your script it should be displaying sidebar 3.
benjaminleist
Member
Posted 1 year ago #
My index/home page is a page created by me, labeled "home".
The blog/news is displayed on a page created by me, labeled "news".
http://www.belite.de/index.php (in german)
Thanks a lot!
benjaminleist
Member
Posted 1 year ago #
benjaminleist
Member
Posted 1 year ago #
Guys, that's really important :/
ryanhellyer
Member
Posted 1 year ago #
I still don't get it. Like I said before, isn't your news page supposed to be rendering sidebar 3 anyway? Or did I completely misread the code?
benjaminleist
Member
Posted 1 year ago #
Ryan, could there be a function like is_article_page or something like that? I'm using 2.5.1 like I said before, and changed the settings to:
home site (www.belite.de) displaying a page, not the articles
news site (www.belite.de/news) displaying the articles
Maybe that's the reason?
benjaminleist
Member
Posted 1 year ago #
if (is_page('home')) (!function_exists('dynamic_sidebar') || !dynamic_sidebar(2));
elseif (is_page('aktuelles')) (!function_exists('dynamic_sidebar') || !dynamic_sidebar(3));
else (!function_exists('dynamic_sidebar') || !dynamic_sidebar(1));
aktuelles = news