Skip to:
Content
Pages
Categories
Search
Top
Bottom

[Resolved] Help with bp conditionals

  • I am running an installation of BP with the external groups blog plugin.
    I use the plugin to pull a feed from twitter – for which I do not want to display the excerpt when its on the home page.
    It is displayed on the home page in the form of a sidebar widget. I need to excerpt to appear on the groups page, activity page, etc. but NOT appear on the widget.

    I’ve tried is_home(), is_front_page(), bp_is_home(), bp_is_front_page(), bp_is_activity_front_page()

    You can see the code here: chopapp.com/#xe0jfeaf

    Thanks for your help!!

Viewing 5 replies - 1 through 5 (of 5 total)

  • Boone Gorges
    Keymaster

    @boonebgorges

    I would have thought that `is_home()` or `is_front_page()` would work properly. When you say that these functions don’t work, do you mean that the excerpts are not appearing where they should, or that they’re appearing where they shouldn’t?

    I’ve tried running it with if is_home(){ // some code } and the code doesn’t run. My guess is that it’s because its in a widget on the home page sidebar? Could this be? Is there any conditional function to check for this?

    is_front_page(){//code} also doesn’t run the code in the conditional block


    Boone Gorges
    Keymaster

    @boonebgorges

    Weird. I just tried inserting the following into an existing widget and it worked fine

    `

    test

    `

    Does is_front_page() work properly if you put it in the template that produces the content itself? It could be that something about your setup is keeping the front page from being recognized as such.

    Right now I’m writing it into the plugin file.

    I’m building on top of the Salutation BP theme from themeforest:

    The theme uses create_page_layout() to generate layouts as design-{name}.php
    When I check for is_front_page() in design.php (the layout that is being called by index.php) it runs the code.

    Fixed it by using a display none on the home-page body class. Not elegant but it works.

    Thanks for your help!

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘[Resolved] Help with bp conditionals’ is closed to new replies.
Skip to toolbar