Forums

Widget Logic and Static Front Pages (10 posts)

  1. stuntmusic
    Member
    Posted 1 year ago #

    I have used thsi plug in many times, however, it is behaving unexplainably right now.

    I have a blog that I have set the READING option to be static pages for both the 'front page' AND the 'posts page'.

    I have a number of pages that use a text widget to call the images and navigation I am using, and it works for every single page, including the front page, but no matter what I do, it does not work with the 'Posts Page'.

    I've tried all the conditional tags I could find, inlcuding is_home(), is_page('blog'), is_page('27'), is_front_page() and a few others that I just tried to make up as I went.

    No matter what I do, it's a no go. Any thoughts on what I can try to get this to work?

    I've tried using standard permalinks, modified permalinks and anything else I can think of.

    The only thing I can think of is something about the 'posts page' is causing the problem because it is an archive or some sort.

  2. alanft
    Member
    Posted 1 year ago #

    if i read you correctly, you have many different widgets set to appear on different parts of your site, but the widget set to appear on the main posts page (set to be a static page) is not appearing

    the static posts page you nominate to be the posts page provides the url for the posts page, and does return true with is_home() - at least on a blank setup.

    could it be that the static page you are nominating for the posts page has a template - and that template is running some unusual php code? of course it could be your page.php code (etc) that's unusual and messing up the conditional tags too.

    but is_home() should definitely work. try switching to the default theme and see if the problem goes away.

  3. stuntmusic
    Member
    Posted 1 year ago #

    I've tried it with a couple of templates and it doesn't work.

    If I choose one page to be the 'front' page and then another page to be the 'posts' page, I can get the widget to work for the 'front' page using is_home() but nothing I do will get the widget logic to work for the 'posts' page

    The design sorks with all the logic and pages and everything with the exception of the 'posts' page, so it's not the design or the page template itself. if it were that, I would expect it to break other pages.

    The permalinks are set to be /%postname%/

  4. alanft
    Member
    Posted 1 year ago #

    when i get back to the test system i tried it on (mentioned above it worked ok) i will go through it more carefully. if all is still well, i will post up the steps i took in getting it working as expected.

  5. moshu
    Member
    Posted 1 year ago #

    According to the Codex:
    Conditional_Tags#The_Main_Page
    is_home should work on "posts page" and is_front_page on a static frontpage.
    Maybe the plugin doesn't know this?

  6. alanft
    Member
    Posted 1 year ago #

    there is no reason i can think of that the plugin wouldn't be able to use these conditional tags - and certainly seemed to on my first quick naive test. i will look asap - but it won't be for a day or so. come back in a bit.

    cheers

  7. moshu
    Member
    Posted 1 year ago #

    there is no reason i can think of that the plugin wouldn't be able to use these conditional tags

    Well, the reason would be if it was released before the "select a static frontpage" gizmo was introduced in WP, and the new is_front_page conditional was set up. Before that there was no such conditional tag.

  8. stuntmusic
    Member
    Posted 1 year ago #

    I will try these tags again to see if I can get it to work

  9. stuntmusic
    Member
    Posted 1 year ago #

    Ok, it is now working.

    Perhaps I missed something or fat fingered something, but its now working as expected.

    Thanks for the help.

  10. alanft
    Member
    Posted 1 year ago #

    ok great :-)

    Well, the reason would be if it was released before the "select a static frontpage" gizmo was introduced in WP

    sorry, i should have said 'knowing the way the plugin works, there is no reason i can think of...'. as the plugin doesn't need to 'know' about new conditional tags - it just exec's PHP to get a true or a false. thanks tho.

Topic Closed

This topic has been closed to new replies.

About this Topic