Skip to:
Content
Pages
Categories
Search
Top
Bottom

Legacy and Nouveau Templates in One Theme


  • nm
    Participant

    @nahummadrid

    I have had a fear of missing out ever since nouveau came out so I keep wanting to maintain both template packs for the same theme and I’ve still been hung up on this question: https://buddypress.org/support/topic/bp-nouveau-vs-bp-legacy/

    Is this the solution or on the right path?

    add_filter( 'bp_get_template_stack', 'my_template_pack_stack' );
    function my_template_pack_stack( $stacks = array() ) {
      $retval = array();
        if( bp_get_theme_package_id()  === 'nouveau') {
      $retval[] = '/buddypress/bp-nouveau';
    } elseif(bp_get_theme_package_id()  === 'legacy') {
       $retval[] = '/buddypress/bp-legacy';
    }
      foreach ($stacks as $stack) {
        $retval[] = $stack;
      }
      return $retval;
    }

    seems to work along with conditionally including custom stylesheet for respective template pack but just not sure about it

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

  • nm
    Participant

    @nahummadrid

    oops sorry I put in the wrong snip then I couldn’t edit…here’s what “seems” to be working for me.

    add_filter( 'bp_get_template_locations', 'my_template_pack_stack' );
    
    function my_template_pack_stack( $locations = array() ) {
    
    if( bp_get_theme_package_id()  === 'nouveau') {
    
    $locations[] = '/buddypress/bp-nouveau';
    
    } elseif( bp_get_theme_package_id()  === 'legacy') {
    
    $locations[] = '/buddypress/bp-legacy';
    
    }
    
      return $locations;
    }
    

    nm
    Participant

    @nahummadrid

    If the above is working with template files, why wouldn’t overwriting buddypress.css via /buddypress/bp-legacy/css be working like it would under /buddypress/css or /community/css?

Viewing 2 replies - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.
Skip to toolbar