Skip to:
Content
Pages
Categories
Search
Top
Bottom

Buddypress Pages Post ID

  • Avatar of mizzinc
    mizzinc
    Participant

    @mizzinc

    Hello.

    WordPress: 3.6.1
    Buddypress: 1.8.1

    When viewing any of the three default pages (Activity, Groups, Members) the post ‘ID’ ($post->ID or the_ID()) returns ’0′ in a wordpress theme file ‘content-page.php’

    <article id="post-0" class="post-0 bp_members type-bp_members status-publish hentry">
    <header class="entry-header">
    <h1>Members</h1>
    </header>
    <div class="entry-content">
    <div id="buddypress">
    

    I have searched support and not found anyone with a similar problem, so It might be theme related, that said, I am just starting out, so if anyone has some thoughts on why this is happening would be greatly appreciated to help to resolve it.

Viewing 7 replies - 1 through 7 (of 7 total)
  • Avatar of Hugo
    Hugo
    Moderator

    @hnla

    What’s the problem?

    BP pages are not strictly posts they use the_content() to simply pass through BP data, they are a sort of faux post.

    Why do you need a class there, there are plenty of class tokens to hook onto.

    Avatar of mizzinc
    mizzinc
    Participant

    @mizzinc

    Wow, fast response.

    Hi Hugo, I require the post ID when viewing a page to access post_meta information. This works when accessing a WordPress page. When accessing the default ‘Activity, Groups or Members’ page the post ID returns ’0′, why?

    Avatar of Hugo
    Hugo
    Moderator

    @hnla

    sorry extended my response above.

    You may need to explain why you want or need post_meta for a bp page, there wouldn’t be any would there?

    Avatar of mizzinc
    mizzinc
    Participant

    @mizzinc

    Simple styling options. Show/Hide page title, breadcrumbs, feature image?

    Hmm, after reading your extended response, perhaps I am approaching this from the wrong angle.

    Avatar of Hugo
    Hugo
    Moderator

    @hnla

    Think you are, but not quite sure what to suggest, but using options table is a possibility? But even then you have to remember that the page doesn’t really exist or at least technically you only have one template file to add logic to, although you can extend that with the additions made to template hierarchy in 1.8.

    You possibly need to be targeting filters at the content based on a page check perhaps in combo with a series of option values?

    Avatar of mizzinc
    mizzinc
    Participant

    @mizzinc

    Ok. Think the filter route is the way to go. I will post my results.

    Thanks Hugo.

    Avatar of mizzinc
    mizzinc
    Participant

    @mizzinc

    Solution:

    Well not really, I just added a conditional around the ‘<header class=”entry-header”>’ to not display if on a BP blog page.

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

You must be logged in to reply to this topic.