This topic has 8 replies, 3 voices, and was last updated 8 years by sharmstr.

  • Author
  • #62749
     Patagonia
    Participant

    Hi, my BP sub pages use the template I chose in theme settings > buddypress.
    But the BP main pages (members, activity etc) do not. Tthey seem to use the standard Page.php template, which I edited (but those edits don’t make sense for BP and give errors).

    How can I make/choose one overall template for the BP main pages?

    cheers

    #62914
     Laura
    Moderator

    Hello, do you want to show the bp sidebar in members and activity page? If so, i can guide you so you can do the changes in child theme 🙂

    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution

    Laura Solanes - Graphic Designer and Web Designer

    Please be patient as I try to answer each topic as fast as i can.

    If you like the theme or the support you've received please consider leaving us a review on Themeforest!

    Always happy to help you 🙂

    #63302
     Patagonia
    Participant

    Hi Laura,

    no, what I want to do is make a page template with some extra code within the loop (underneath the featured image).

    It seems that the only way to do this is to make a whole new page type, as the page templates do not cover the main part; if I change content-page.php, then all pages (including the mentioned BP ones) have the change, which is what I don’t want.

    So now I have solved it by creating a new template which calls a new content type: content-edited-page.php, not sure if this is the way to go. Just a bit different code should not warrant a new content-type?

    Cheers

    #63316
     sharmstr
    Moderator

    Why can’t you use !bp_is_blog_page()?

    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution

    This support site is not about custom work. If you need custom development please contact cornel@seventhqueen.com

    #63336
     Patagonia
    Participant

    Why can’t you use !bp_is_blog_page()?

    I don’t know because I do not know what you mean with that 🙂

    #63337
     sharmstr
    Moderator

    LOL. Sorry.

    So you’re saying that you want to add something to buddypress pages only, but dont want to create a separate template file for it, right?

    bp_is_blog_page() is a bp function that will tell you if you are on a page that ISNT a bp page. So, if you add an ! to it, you’re asking “Is this a bp page?”

    In your page.php file you can do this

    COPY CODE
    
     if (!bp_is_blog_page()) {
    echo "Hey!  I'm a buddypress page";
    }
    
    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution

    This support site is not about custom work. If you need custom development please contact cornel@seventhqueen.com

    #63338
     sharmstr
    Moderator

    Lots of other goodness here: https://codex.buddypress.org/developer/template-tag-reference/

    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution

    This support site is not about custom work. If you need custom development please contact cornel@seventhqueen.com

    #63347
     Patagonia
    Participant

    Ah, ok, yes that might work. I am ok with making more templates, but the problem is I want to edit the part that is not covered by the templates. There is no template that goes between general-before-wrap & general-after-wrap I think.

    So the only choice is to make a complete new page type like content-edited.php in the child theme root, and a real new template which then calls get_template_part( 'content', 'edited' ); which calls new page parts. Just seems a bit impractical and was a big puzzle for me.

    This also mean I cannot set this as a default template as far as I can see.

    #63393
     sharmstr
    Moderator

    There’s a couple of ways to do this. You can do it as I’ve already outlined, or you might be able to inject it using a function in your childs function file. Tell me exactly where you want it and on what pages.

    BTW – there are several templates that go between general-before-wrap & general-after-wrap. It all depends on the page you’re viewing. Again, let me know where you want the new content.

    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution

    This support site is not about custom work. If you need custom development please contact cornel@seventhqueen.com

Viewing 9 posts - 1 through 9 (of 9 total)

The forum ‘General questions’ is closed to new topics and replies.

Log in with your credentials

Forgot your details?