WordPress.org

Ready to get started?Download WordPress

Forums

[plugin: Widget Context] static home page (7 posts)

  1. rebelit
    Member
    Posted 3 years ago #

    Hi,
    I have used widget context on many sites I have designed, but I am having trouble with my latest site.

    I am using a static front page using a very simple template...

    <?php
    	/*
    	Template Name: public
    	*/
    	include TEMPLATEPATH . "/index.php";
    ?>

    but I cannot get my widget to show (or hide) only on the front page I have tried checking these options
    Front Page
    Blog Index

    and in target by url using
    <home>
    home
    /

    etc...
    It just doesn't work in this one case.

    Am I doing something stupid?

  2. anotherbreed
    Member
    Posted 3 years ago #

    Same here... please help!

    <home> doesn't work at all! :(

  3. rebelit
    Member
    Posted 3 years ago #

    I edited the plugin php for my purposes in the end. Just make sure you also modify the name and folder name rather then do it to the original code.

    It's been coded quite nicely and is easy to understand.

    Goog luck

  4. Kaspars
    Member
    Posted 3 years ago #

    rebelit, you should simply select "Show on selected" and choose "Front page", while leaving everything else unchecked and empty (including the target by URL box).

  5. solutionsphp
    Member
    Posted 2 years ago #

    I'm having this issue as well. Show on selected with Front Page and nothing else isn't working for me. I also tried applying the patch here, along with several different variations of the target URL format, to no avail: http://wordpress.org/support/topic/plugin-widget-context?replies=25

    The plugin is working as expected on other pages/posts, just not my static front page.

    UPDATE: This problem is being caused by my use of is_front_page() just below the loop. If I remove that, Widget Context will target the front page as expected. I need to use that function though, so I'm looking for a workaround. Any ideas?

  6. Kaspars
    Member
    Posted 2 years ago #

    @solutionsphp Are you sure you don't run a custom query for posts on that page?

    Try placing wp_reset_query() after your loop and before the widget area.

    http://codex.wordpress.org/Function_Reference/wp_reset_query

  7. solutionsphp
    Member
    Posted 2 years ago #

    Yes, I'm running a custom query, and forgot about wp_reset_query() (was using rewind_posts.) Adding this after my loop totally fixed my problem. Thank you!

Topic Closed

This topic has been closed to new replies.

About this Topic