Viewing 2 replies - 1 through 2 (of 2 total)
  • Hi Ronald Huereca
    We have tested our plugin with Twenty Fourteen theme, it work fine :).
    Please compare with default theme and check your theme again.

    Thread Starter Ronald Huereca

    (@ronalfy)

    ntsasng,

    Thank you for the reply. I’m afraid there was a mis-communication because it is indeed not working with a default WordPress install and the Twenty Fourteen theme.

    Here’s how to duplicate.

    1. Create empty WP install using default theme
    2. Create a page called “Blog”
    3. Configure the plugin to override the sidebars you want
    4. Go into the “Blog” page and edit the widgets.
    5. View page and the plugin works fine overriding widgets
    6. Now go into Settings->Reading and select a Static Page and for Posts select the “Blog” page.
    7. View the “Blog page” and the regular widgets are showing.

    The code I posted kinda gives a highlight on how to fix it since I use the same filters your plugin does, just that it only works for the is_home conditional, which will return true if we’re on a blog index page. Granted, my code isn’t perfect because is_home can return true even if we’re on the front page of the site with no Static Front Page set, but you can view full details here: http://codex.wordpress.org/Function_Reference/is_home

    So to sum up the issue, if you set a Static Front Page, the blog index page does not show the conditional widgets because the code in your plugin is checking for is_singular, which will return false for the blog index page.

    If you have a GitHub or some other public repo that accepts pull requests, I’d be happy to submit a patch.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Does not work on is_home’ is closed to new replies.