• I’ve got a page set as my static front page and another page (/blog/) set for my posts page (the one that triggers is_home()).

    But, when I put a Section Widget in and want it to appear on all blog pages, I can’t. On the Special Pages tab I select “All posts” and “All category archive pages”, and on the Pages tab I select the “Blog” page. But while the widget does appear on single post pages and category archives, it doesn’t appear on /blog/ itself.

    I’ve run basic tests and it seem that is_home() returns true on /blog/, but oddly is_page('blog') returns false!

    I’m not sure about the is_page() issue – but maybe the Section Widget should have an option under Special Pages for the Home/Posts page as well as Front Page?

Viewing 9 replies - 1 through 9 (of 9 total)
  • Hi gyrus, nice to hear from you again. Because you seems to know quite a lot about the conditional tags, we’ll speak code here ??

    I think the problem is it is missing a is_home() option, becuase technically the “home” page is not a category archive page nor a “normal” static page. Therefore I just need to add an option for is_home(). The problem is how should I word it to make it less confusing. Any suggestions?

    Thread Starter Steve Taylor

    (@gyrus)

    Hi Godfrey, yes, let’s drop the English and just post in witty PHP ??

    How to make it less confusing, good question! I just had to explain to a client why is_home() doesn’t test as true on the home page (which is static), and I realized how confusing it can be if you’re not used to the WP way. But I think the answer is on the Reading settings page: they use “Front page” and “Posts page”. Coders are stuck with is_home(), but when talking English, I think these two terms are the best way of making the difference clear.

    So, a “Posts page” option, together with a brief explanation like the other Special pages, would be great.

    Thanks for the input, I’m hoping to implement that in the very near future. ??

    Gyrus,

    I have updated the plugin to include that option. Check it out and let me know what you think. As for the inversion thing, I have put it on hold because it requires more thoughs.

    Godfrey

    Thread Starter Steve Taylor

    (@gyrus)

    Excellent! Many thanks Godfrey, great work.

    Am I correct that if I use this plugin, I will no longer need Widget Logic?

    Yes and no — Widget Logic works by adding a condition extra field to ALL exisiting widgets, while Section Widget is a standalone widget and won’t touch other existing widgets at all. This means, if you really need to hide some of your existing widgets conditionally, widget logic is what you would need. However, section widget comes with short code support and most common widgets can actually be replaced by a section widget with the proper shortcode.

    Thank you, Godfrey. Will Section Widget and Widget Logic conflict with each other?

    AFAIK, they won’t.

Viewing 9 replies - 1 through 9 (of 9 total)
  • The topic ‘[Plugin: Section Widget] Posts page and is_home() issue’ is closed to new replies.