Skip to:
Content
Pages
Categories
Search
Top
Bottom

Sidebar reappear in topic and topic/


  • gogitossj34
    Participant

    @gogitossj34

    Hey guys, I’ve been looking everywhere for this
    I installed bbpress and made a forum ( just testing ).
    I want my forum to be full width and without the side bar. Tried the “1 column full width” layout and some custom css.
    The best I’ve got is a no-full-width forum WITHOUT side bar in the /forum/ page.
    But further than that like /forum/topic/… the side bar reappear.
    My site is http://mmo4teens.netai.net/ and my theme is Stargazer Colloquium.
    Any help is appreciated.
    Thanks in advance.

Viewing 25 replies - 1 through 25 (of 38 total)

  • Robin W
    Moderator

    @robin-w


    gogitossj34
    Participant

    @gogitossj34

    Thanks for the fast reply but my theme doesn’t have different template like that.
    I have also tried to create my own template but my theme doesn’t have a page.php file and the index.php file doesn’t call the side bar but the footer.php file does.
    So, if I need to create a new template, can you guide me. The documentation doesn’t have anything relate to the footer ( according to what I’ve found ) so I’m pretty stuck.


    Robin W
    Moderator

    @robin-w

    ok, so in your PC create a file called bbpress.php

    (you can use notepad for this)

    then dump this code into it

    <?php
    
    /**
     * bbPress - Forum Archive
     *
     * @package bbPress
     * @subpackage Theme
     */
    
    get_header(); ?>
    
    	<?php do_action( 'bbp_before_main_content' ); ?>
    
    	<?php do_action( 'bbp_template_notices' ); ?>
    
    	<div id="forum-front" class="bbp-forum-front">
    		<h1 class="entry-title"><?php bbp_forum_archive_title(); ?></h1>
    		<div class="entry-content">
    
    			<?php bbp_get_template_part( 'content', 'archive-forum' ); ?>
    
    		</div>
    	</div><!-- #forum-front -->
    
    	<?php do_action( 'bbp_after_main_content' ); ?>
    
    <?php get_sidebar(); ?>
    <?php get_footer(); ?>

    save it and using ftp copy it to get

    wp-content/themes/%yourthemename%/

    where %yourthemename% is the name of your theme

    so you end up with

    wp-content/themes/%yourthemename%/bbpress.php

    bbpress will then use this template

    Come back and let us know how you get on !


    gogitossj34
    Participant

    @gogitossj34

    thanks a lot
    I’ll give it a try and report back to you guys.


    gogitossj34
    Participant

    @gogitossj34

    Well, not as I expected to be.
    On the main forum page, the sidebar and my page menu get pushed down and it’s now showing archive and categories too ( which wasn’t there before ).
    Also, the forum is still not full width.
    On the topic and other place, it’s the same thing but the forum is full width.
    One big problem is, it doesn’t show my old topic although I created a test one.
    Interestingly, it still show the 1 post , 2 replies,… but when I click in it, it shows no topic but the link in the address bar was the right title I gave to my test post.
    Any thing you guys can make out from that ?


    gogitossj34
    Participant

    @gogitossj34

    Okay, I’ve just tried to delete the line get_footer in my old bbpress.php file and it worked. The only problem now is how to set it to full width. Can you help me with that. Sr for double posting.


    Robin W
    Moderator

    @robin-w

    looks ok to me now – are you fixed?


    gogitossj34
    Participant

    @gogitossj34

    Ok. Now this is what I’m currently have:
    The forum page is okay with full width and no sidebar but topic is still like before, with sidebar.
    Note that I also did thing a bit differently. This time I didn’t remove the get_footer line. Instead I chose the 1 page width layout ( not template ). I did try this before but it didn’t work because I put the [bbp-index] line inside c.o.d.e in the page. After I remove them, it worked.
    So now, I want the topic to be like the forum page, no sidebar and full width.

    And also, I’ve just came across this other things. I notice that there are 2 “forum” page. forumS and forum. the things is. When I access the forum page through the forum permalink, it doesn’t have side bar but when I access it through the forumS permalink like when I click on forums at Home > forums > …, it act just like the topic page.
    This is a long post but to summarize:
    The topic and the forum access from the forums permalink to be full width with no sidebar.

    Thanks in advance.


    Robin W
    Moderator

    @robin-w

    can you post the code from your current bbpress.php


    gogitossj34
    Participant

    @gogitossj34

    Ok, here it is:

    <?php get_header(); // Loads the header.php template. ?>

    <main <?php hybrid_attr( ‘content’ ); ?>>

    <?php if ( have_posts() ) : // Checks if any posts were found. ?>

    <?php while ( have_posts() ) : // Begins the loop through found posts. ?>

    <?php the_post(); // Loads the post data. ?>

    <article <?php hybrid_attr( ‘post’ ); ?>>

    <?php if ( is_singular( get_post_type() ) ) : // If viewing a single page. ?>

    <header class=”entry-header”>
    <h1 <?php hybrid_attr( ‘entry-title’ ); ?>><?php single_post_title(); ?></h1>
    </header><!– .entry-header –>

    <div <?php hybrid_attr( ‘entry-content’ ); ?>>
    <?php the_content(); ?>
    <?php wp_link_pages(); ?>
    </div><!– .entry-content –>

    <?php else : // If not viewing a single page. ?>

    <header class=”entry-header”>
    <?php the_title( ‘<h2 ‘ . hybrid_get_attr( ‘entry-title’ ) . ‘>‘, ‘</h2>’ ); ?>
    </header><!– .entry-header –>

    <div <?php hybrid_attr( ‘entry-content’ ); ?>>
    <?php the_content(); ?>
    <?php wp_link_pages(); ?>
    </div><!– .entry-content –>

    <?php endif; // End single page check. ?>

    </article><!– .entry –>

    <?php endwhile; // End found posts loop. ?>

    <?php else : // If no posts were found. ?>

    <?php locate_template( array( ‘content/error.php’ ), true ); // Loads the content/error.php template. ?>

    <?php endif; // End check for posts. ?>

    </main><!– #content –>

    <?php get_footer(); // Loads the footer.php template. ?>


    Robin W
    Moderator

    @robin-w

    ok, it would be good to lose that horrible ad that comes up as I transition every page – it would stop me using your site immediately :-)

    Sorry, this is like trying to fix a car by email – we’ll get to a solution, but I’m not alweays understanding what you are seeing or saying.

    The topic and the forum access from the forums permalink to be full width with no sidebar.

    So why can’t you use this as you solution?


    gogitossj34
    Participant

    @gogitossj34

    Oh, the popup you mean. That isn’t mine. I’m using free hosting so…
    Or could you post a picture of that.
    And sorry for being hard to understand, I’m basically trying to make this with no sidebar and full width.
    And I’ve just found out something, my sidebar isn’t left and right, it’s primary and subsidary.
    The one that is currently on my site is primary.
    Hope that help.


    Robin W
    Moderator

    @robin-w

    Hey no need to apologise, it’s often difficult to resolve these things, and it’s not due to your lack of explanation, it will just be something simple that needs fixing !

    can you try the following as your bbpress.php

    <?php get_header(); // Loads the header.php template. ?>
    
    <main <?php hybrid_attr( ‘content’ ); ?>>
    
    <?php if ( have_posts() ) : // Checks if any posts were found. ?>
    
    <?php while ( have_posts() ) : // Begins the loop through found posts. ?>
    
    <?php the_post(); // Loads the post data. ?>
    
    <article <?php hybrid_attr( ‘post’ ); ?>>
    
    <header class=”entry-header”>
     <?php the_title( ‘<h2 ‘ . hybrid_get_attr( ‘entry-title’ ) . ‘>‘, ‘</h2>’ ); ?>
     </header><!– .entry-header –>
    
    <div <?php hybrid_attr( ‘entry-content’ ); ?>>
     <?php the_content(); ?>
     <?php wp_link_pages(); ?>
     </div><!– .entry-content –>
    
    </article><!– .entry –>
    
    <?php endwhile; // End found posts loop. ?>
    
    <?php else : // If no posts were found. ?>
    
    <?php locate_template( array( ‘content/error.php’ ), true ); // Loads the content/error.php template. ?>
    
    <?php endif; // End check for posts. ?>
    
    </main><!– #content –>
    
    <?php get_footer(); // Loads the footer.php template. ?>

    gogitossj34
    Participant

    @gogitossj34

    I tried it but this happen when I get in the General:
    Parse error: syntax error, unexpected T_STRING in …/bbpress.php on line 14

    You can see it here
    http://mmo4teens.netai.net/forums/forum/general/

    I don’t know if this is right but the error seems to be in this line ( ran some php code checker and read the error on my page):

    <?php the_title( ‘<h2 ‘ . hybrid_get_attr( ‘entry-title’ ) . ‘>‘, ‘</h2>’ ); ?>


    Robin W
    Moderator

    @robin-w

    Ok, not sure if you fixed something or just represhed, but as far as I can see you’re now all working?


    gogitossj34
    Participant

    @gogitossj34

    Okay, now this is what I did:
    I replaced the line above

    <?php the_title( ‘<h2 ‘ . hybrid_get_attr( ‘entry-title’ ) . ‘>‘, ‘</h2>’ ); ?>

    with this line in my old bbpress.php file because I see they are in the similar position and the page work ok.

    <?php the_title( ‘<h2 ‘ . hybrid_get_attr( ‘entry-title’ ) . ‘>‘, ‘</h2>’ ); ?>

    But at the topic page, it pushed the sidebar to the bottom. So, I deleted the get footer line and everything looks exactly how I want them to be.

    Only that now I don’t know if they’ll be any problem, especially when I removed the get footer line.

    The fact that I changed your code also is worrying me since I have absolutely no knowledge about php coding. I mean, I’ve found out there is a something called php coding.

    Anyway, here is my footer.php content, can you check if anything is important ?

    <?php hybrid_get_sidebar( ‘primary’ ); // Loads the sidebar/primary.php template. ?>

    </div><!– #main –>

    <?php hybrid_get_sidebar( ‘subsidiary’ ); // Loads the sidebar/subsidiary.php template. ?>

    </div><!– .wrap –>

    <footer <?php hybrid_attr( ‘footer’ ); ?>>

    <div class=”wrap”>

    <?php hybrid_get_menu( ‘social’ ); // Loads the menu/social.php template. ?>

    <p class=”credit”>

    <?php printf(

    /* Translators: 1 is current year, 2 is site name/link, 3 is WordPress name/link, and 4 is theme name/link. */

    __( ‘Copyright © %1$s %2$s. Powered by %3$s and %4$s.’, ‘stargazer’ ),

    date_i18n( ‘Y’ ), hybrid_get_site_link(), hybrid_get_wp_link(), hybrid_get_theme_link()

    ); ?>

    </p><!– .credit –>

    </div><!– .wrap –>

    </footer><!– #footer –>

    </div><!– #container –>

    <?php wp_footer(); // WordPress hook for loading JavaScript, toolbar, and other things in the footer. ?>

    </body>

    </html>


    Robin W
    Moderator

    @robin-w

    Hey don’t worry, code is just a bunch of stuff that either works or doesn’t – and yours now works.

    what I couldn’t figure out was why the sidebar was showing, and now that you’ve posted the footer.php I can see why. Strange bit of theme coding to put the sidebar in a footer.php but there are only conventions not rules. All you’ve done by deleting the footer line is stop the sidebar running, which is what you wanted.

    The fact that I changed your code also is worrying me since I have absolutely no knowledge about php coding. I mean, I’ve found out there is a something called php coding.
    

    Don’t worry you’ve done nothing wrong, it’s all good.

    NOW the only thing you’ll need to do is make a note of all the changes you made. Themes sometimes have updates, and these may overwrite existing files, and in your case may also delete the bbpress.php. So keep copies of any files you have changed or added on your PC.


    gogitossj34
    Participant

    @gogitossj34

    Ok, thanks a lot for your help, Robin.
    But ah, just wondering, is there anyway to achieve this but still leave the footer intact like ah move the line get_sidebar from the footer.php file to somewhere else since apparently, some features require the footer.php


    Robin W
    Moderator

    @robin-w

    absolutely there is, but if you’ve only taken out the footer in bbpress.php, then it will only have been taken out for bbpress, so will still be available elsewhere.

    otherwise do come back


    gogitossj34
    Participant

    @gogitossj34

    yes, but I want it to be available even in the forum.


    Robin W
    Moderator

    @robin-w

    ok no problem

    Normally you would have a bbpress.php that would contain

    header stuff
    while have posts loop stuff
    do_sidebar stuff
    do_footer stuff

    Your theme has decided that the sidebar stuff will be in the footer stuff.

    Now all this will work for non bbpress pages, so all we need to do is stop sidebars for bbpress pages.

    so put back the footer line in bbpress.php

    and then edit footer.php to make the first lines that were

    <?php hybrid_get_sidebar( ‘primary’ ); // Loads the sidebar/primary.php template. ?>
    
    </div><!– #main –>
    
    <?php hybrid_get_sidebar( ‘subsidiary’ ); // Loads the sidebar/subsidiary.php template. ?>
    

    change to

    <?php if !bbpress() {hybrid_get_sidebar( ‘primary’ ); } // Loads the sidebar/primary.php template.?>
    
    </div><!– #main –>
    
    <?php if !bbpress() {hybrid_get_sidebar( ‘subsidiary’ ); }// Loads the sidebar/subsidiary.php template. ?>
    

    essentially that code says ‘if the page is not a bbpress page ‘ the do the sidebar stuff the ‘!’ is a not statement and bbpress() checks if we are dispaying a bbprtess page

    Give it a try, and come back and let me know if it works.


    gogitossj34
    Participant

    @gogitossj34

    The sidebar ( actually the footer ) is gone in every page and I’m getting this error showing instead of the footer.

    Parse error: syntax error, unexpected ‘!’, expecting ‘(‘ in /home/a7203024/public_html/wp-content/themes/stargazer/footer.php on line 1


    Robin W
    Moderator

    @robin-w

    late night brain fade

    try

    <?php if (!bbpress()) {hybrid_get_sidebar( ‘primary’ ); } // Loads the sidebar/primary.php template.?>
    
    </div><!– #main –>
    
    <?php if (!bbpress()) {hybrid_get_sidebar( ‘subsidiary’ ); }// Loads the sidebar/subsidiary
    

    gogitossj34
    Participant

    @gogitossj34

    I’m getting this instead
    Parse error: syntax error, unexpected ‘<‘ in /home/a7203024/public_html/wp-content/themes/stargazer/footer.php on line 7

    I noticed that your code was missing a .?> thing so I added it and no error but the sidebar is now hidden in everypage.


    Robin W
    Moderator

    @robin-w

    The fact that your theme has coded the sidebar in the footer is really annoying !

    No idea why that isn’t working, but plan b

    change footer.php back to how it was, that way all the other pages will work.

    now go back into bbpress.php and instead of the

    <?php get_footer(); // Loads the footer.php template. ?>
    

    paste the footer.php code, but without the two sidebar lines

    
    
    </div><!– #main –>
    </div><!– .wrap –>
    <footer <?php hybrid_attr( ‘footer’ ); ?>>
    <div class=”wrap”>
    <?php hybrid_get_menu( ‘social’ ); // Loads the menu/social.php template. ?>
    <p class=”credit”>
    <?php printf(
    /* Translators: 1 is current year, 2 is site name/link, 3 is WordPress name/link, and 4 is theme name/link. */
    __( ‘Copyright © %1$s %2$s. Powered by %3$s and %4$s.’, ‘stargazer’ ), 
    date_i18n( ‘Y’ ), hybrid_get_site_link(), hybrid_get_wp_link(), hybrid_get_theme_link()
    ); ?>
    </p><!– .credit –>
    </div><!– .wrap –>
    </footer><!– #footer –>
    </div><!– #container –>
    <?php wp_footer(); // WordPress hook for loading JavaScript, toolbar, and other things in the footer. ?>
    

    and see what that does ! Sorry without having your theme, I’m guessing at some of the code, and am as before likely to miss some grammer so you may need to play a bit with it.

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