pundurbrother
Member
Posted 10 months ago #
Hi, everyone!
I can not resolve trouble with current_page_item function.. I just can not find mistake in the script. My page is http://www.freeskate.lv, I am using Gluttony WP theme.
There's suppose to be white background on each page when you click/are on it. But it works only in "Sākums". Can someone look at script and tell me what's wrong?
code from page.php is here http://pastebin.com/jUwpBJbg
and code from stylesheet.css is here http://pastebin.com/b3TzWt52
You need to use wp_list_pages, wp_page_menu or wp_nav_menu to get the current_page class generated.
pundurbrother
Member
Posted 10 months ago #
It's used with wp_list_pages function.
Can you be more specific please? I pasted script in pastebin so everyone can see it.
And it works when you preview original theme http://www.blogenginetheme.com/post/Gluttony.aspx
The code for the top horizontal menu on your site is not being generated by wp_list_pages. Try looking in header.php.
pundurbrother
Member
Posted 10 months ago #
Then what is on 4th line with wp_list_pages?
Header.php is not connected with horizontal menu.
The script I posted already (http://pastebin.com/jUwpBJbg) goes in almost every php file
page.php is not included in almost every php file .
pundurbrother
Member
Posted 10 months ago #
Ok, let me be more specific.. SCRIPT I posted goes in 404.php, archive.php, index.php, page.php, search.php, single.php
The code for the top horizontal menu on your site is not being generated by wp_list_pages.
pundurbrother
Member
Posted 10 months ago #
esmi, I know you are trying to help, but it isn't really helpful if I don't know what do you mean by that. Any clue why original theme works?
the html code of your menu, how it appears in the browser, is very different from what wp_list_pages() would output.
to find the cause, you probably need to share the code of a few of your theme files:
start with:
index.php
page.php
header.php
functions.php
please paste the code of each of the files into a http://pastebin.com/ each and post the links to these here.
can you remember having changed anything menu related in your theme?
added any plugins to style the menu? (what happens to the menu if you deactivate all plugins?)
added any filter functions?
pundurbrother
Member
Posted 10 months ago #
Thank you, alchymyth, when I was trying to style left sidebar menu, I activated Classy list pages plugin (actually I wasn't using it at all) and it seems it caused problems! Deactivated plugin and everything works like a charm now, Thank you one again for helping "alchymyth" and "esmi"