• Resolved mica123

    (@mica123)


    Hello,

    I very much hope for your help.

    As far as I know the page widget in the sidebar adds current_page_item automatically.

    In some themes this works, but there are themes where the current_page_items are not showing up. I have a menu where the current_page_items are showing up correctly, but not in the sidebar page widget.

    Is there something I need to do – add a code in the sidebar.php or somewhere else?

    Many thanks in advance.

Viewing 3 replies - 1 through 3 (of 3 total)
  • try to add
    <?php wp_reset_query(); ?>
    to the beginning of sidebar.php;

    code and custom queries in the main part of the site may have distorted the original $query_string; and ‘wp_reset_query();’ restores it.

    Thread Starter mica123

    (@mica123)

    You are truly wonderful!
    It worked! I put your code under the sbwidgets in the sidebar and it did the trick.

    My heartfelt thanks. I spent days and days over this problem.

    I will play with the styling in the next few days and will let you know
    how I get on.

    Many, many thanks for your kind help.

    Thread Starter mica123

    (@mica123)

    Hello,

    Many thanks again for your help.

    I managed to style everything the way I wanted because your advice enabled me to get the current_page_items back.

    I’ll mark this thread as resolved now.

    All my best wishes.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Page widget current_page_item’ is closed to new replies.