dimanche 4 octobre 2015

How to use diferent template for bbpress in wordpress?

I want to develop a forum in bbpress. The problem I am getting now is I don't know how to use different templates file for bbpress. I want totaly different look for my forum from WordPress main blog. Like I want to show different logo and menu bar on my forum.

How to do it? I tried creating template file like this:

Functions.php

function register_my_menus() {
        register_nav_menu( 'lcs', __( 'LCS Menu') );
        register_nav_menu( 'lcsi', __( 'LCSi Menu' ) );
    }
    add_action( 'init', 'register_my_menus' );

Templ.php

<?php
/**
 * This file adds a custom template to the Genesis Theme.
 *
 * @author Author
 * @link http://mywebsite.com/
 * @package 
 * @subpackage Customizations
 */

/*
Template Name: Full Width Template
*/

$args = array();
if (is_bbpress() ) $args['theme_location'] = 'forumsmenu';
else $args['theme_location'] = 'secforum';
wp_nav_menu($args);

// Add custom body class to the head
add_filter( 'body_class', 'add_body_class' );
function add_body_class( $classes ) {
   $classes[] = 'agentpress-custom';
   return $classes;
}

// Force full width page layout
add_filter( 'genesis_pre_get_option_site_layout', '__genesis_return_full_width_content' );

genesis();

?>

This code is working for the pages but not for bbpress. So my question is

  1. How to use different template file for bbpress in WordPress?
  2. Is there any way to give totally different look to bbpress? e.g. Changing logo and footer

I don't want to use different WordPress installation or database.



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire