Support » Fixing WordPress » is_home() is_front_page() not working in sidebar.php

  • Im trying to add a custom sidebar item in my sidebar.php only on the homepage but cant get the is_home() and is_front_page() functions to work.

    Any ideas??????

Viewing 2 replies - 1 through 2 (of 2 total)
  • Michael


    Forum Moderator

    does the main column contain any custom query without proper resetting?

    try to add wp_reset_query(); before the call of the sidebar.

    I have used add_filter to customize the query in the functions.php within the theme folder. This gives me the custom query but I can’t seem to get functions like, remove_filter or wp_reset_query to work in the index.php. Also, I have tried wrapping the add_filter function with if(is_home) or if(is_front_page) so that only this custom query is used on the front page but it fails to give me the results I want as well. Where could I place this code so that it only applies my filter on the homepage?

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘is_home() is_front_page() not working in sidebar.php’ is closed to new replies.