Results 1 to 6 of 6

Thread: Full-Width Page Template

  1. #1
    Thread Starter
    jschodde's Avatar
    Join Date
    Apr 2009
    Location
    Anthem, AZ
    Posts
    154
    Thanks
    3
    Thanked 1 Time in 1 Post

    Full-Width Page Template

    I use a forum software called Simple:Press (http://simplepressforum.com/) and found that with the CP theme, there's not enough width on the page to reduce vertical forum scrolling due to the sidebar. I ended up creating my own page template called "No Sidebar". Here's the code:

    Code:
    <?php
    /*
    Template Name: No Sidebar
    */
    ?>
    <?php
    get_header( ); 
    ?>
    	<div class="content">
    		<div class="main ins">		
    			<?php if (have_posts()) : while (have_posts()) : the_post(); ?>	
    		
    				<div class="title">
    					<h2><?php the_title(); ?></h2>
    					<div class="clear"></div>
    				</div>
    				
    				<div class="product">
    					<?php the_content(__('Read more &raquo;','cp')); ?>
    					<?php edit_post_link(__('Edit Page','cp'), '
    
    ', '</p>'); ?>
    				</div>
    			
    			<?php endwhile; endif; ?>		
    			
    			<div class="clear"></div>
    		</div>
    	</div>
    
    <?php get_footer(); ?>


    It's a brand-new install so there are no forums listed yet

  2. #2
    amthomas's Avatar
    Join Date
    Jun 2009
    Posts
    21
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Full-Width Page Template

    Thanks for the reply and that is exactly what i need now how do I actually create a new template? and where do i place the code? forgive me for being a neophyte.


    Anthony

  3. #3
    Thread Starter
    jschodde's Avatar
    Join Date
    Apr 2009
    Location
    Anthem, AZ
    Posts
    154
    Thanks
    3
    Thanked 1 Time in 1 Post

    Re: Full-Width Page Template

    Quote Originally Posted by amthomas
    Thanks for the reply and that is exactly what i need now how do I actually create a new template? and where do i place the code? forgive me for being a neophyte.


    Anthony
    Well, you could just copy the code from above and create a php file with any name you want as long as it does not conflict with existing php files. I would put a prefix in front of the filename so you can find it easily for future upgrades and such.

    The files goes in the /wp-content/themes/classipress folder. I named my file "azohvads_no_sidebar.php"

    Whatever page you are using for the forums (and I assume you are using Simple:Press), just specify the "No Sidbar" (for the forum page) as the template and save the page.

    I played around with my template yesterday and decided to go bare-bones with the formatting. You can see it here:
    http://arizonaohvclassifieds.com/forum/

  4. #4
    rtibbs4's Avatar
    Join Date
    Aug 2009
    Location
    United States
    Posts
    358
    Thanks
    9
    Thanked 4 Times in 4 Posts

    Re: Full-Width Page Template

    Hi- I used the following script to create a page template for a full width page and it worked perfectly except that it seems the "ad classified" button doesn't work. It works fine on all other pages but not the full width pages. Has anyone else had that problem?
    Thanks.

    [quote]<?php
    /*
    Template Name: No Sidebar
    */
    ?>
    <?php
    get_header( );
    ?>
    <div class="content">
    <div class="main ins">
    <?php if (have_posts()) : while (have_posts()) : the_post(); ?>

    <div class="title">
    <h2><?php the_title(); ?></h2>
    <div class="clear"></div>
    </div>

    <div class="product">
    <?php the_content(__('Read more &raquo;','cp')); ?>
    <?php edit_post_link(__('Edit Page','cp'), '

    ', '</p>'); ?>
    </div>

    <?php endwhile; endif; ?>

    <div class="clear"></div>
    </div>
    </div>

    <?php get_footer(); ?>
    /quote]

  5. #5
    buddy62's Avatar
    Join Date
    Oct 2009
    Location
    Malaga, Spain
    Posts
    71
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Re: Full-Width Page Template

    I am trying to use "nosidebar" as a landing page, I have found that not only does the post a classified button not work, but when someone posts an ad, you dont get the confirmation message that the ad has been posted, am pretty new to all this, any help out there appreciated

  6. #6
    buddy62's Avatar
    Join Date
    Oct 2009
    Location
    Malaga, Spain
    Posts
    71
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Re: Full-Width Page Template

    I worked it out, if this helps anyone.

    <?php
    /*
    Template Name: nosidebarpage
    */
    require_once dirname( __FILE__ ) . '/form_process.php';
    get_header( );
    include_classified_form();
    ?>


    <div class="content">
    <div class="main ins">
    <?php if (have_posts()) : while (have_posts()) : the_post(); ?>

    <div class="title">
    <h2><?php the_title(); ?></h2>
    <div class="clear"></div>
    </div>

    <div class="product">
    <?php the_content(__('Read more &raquo;','cp')); ?>
    <?php edit_post_link(__('Edit Page','cp'), '

    ', '</p>'); ?>
    </div>

    <?php endwhile; endif; ?>

    <div class="clear"></div>
    </div>
    </div>

    <?php get_footer(); ?>

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)