WordPress.org

Ready to get started?Download WordPress

Forums

willingness
[resolved] full width page? (10 posts)

  1. SuzyB
    Member
    Posted 7 months ago #

    I am not really going to use the blog, does this theme come with an option for a full width page?

  2. Manish Suwal 'Enwil'
    Member
    Theme Author

    Posted 7 months ago #

    If you don't keep any widgets on both the sidebar then this theme will automatically adopt full width style.

  3. SuzyB
    Member
    Posted 7 months ago #

    okay... but I can't have it in one page and not another.

  4. Manish Suwal 'Enwil'
    Member
    Theme Author

    Posted 7 months ago #

    You mean you want sidebar only in some pages. And you want some pages to be full width?

    If so, it's easy.

    You just need to paste a code, which I'll send you tomorrow. And thank you for notifying about this. I'll add option for a full width page in the next update. :-)

  5. SuzyB
    Member
    Posted 7 months ago #

    That's awesome thanks so much!

  6. SuzyB
    Member
    Posted 7 months ago #

    Just a reminder awaiting that code?
    :)

  7. Manish Suwal 'Enwil'
    Member
    Theme Author

    Posted 7 months ago #

    SuzyB,

    You need to create a new file in Willingness theme folder via FTP. Name it page_fullwidth.php

    Keep the following code on page_fullwidth.php

    <?php
    /**
     * Template Name: Full Width Template
     *
     * @package willingness
     */
    
    get_header(); ?>
    
    <style type="text/css">
    
    #content {
      width: 100%;
      padding: 0;
    }
    .no-right .site-content {
    margin: 0 0 0 0;
    }
    .no-left .site-content {
      margin: 0 0 0 0;
    }
    .no-left .no-right .site-content{
      margin: 0 0 0 0;
    }
    .site-content{
      margin: 0;
    }
    #secondary{
      display: none;
    }
    #right-sidebar{
      display: none;
    }
    
    </style>
    
      <div id="primary" class="content-area">
        <div id="content" class="site-content" role="main">
    
          <?php while ( have_posts() ) : the_post(); ?>
    
            <?php get_template_part( 'content', 'page' ); ?>
    
            <?php
              // If comments are open or we have at least one comment, load up the comment template
              if ( comments_open() || '0' != get_comments_number() )
                comments_template();
            ?>
    
          <?php endwhile; // end of the loop. ?>
    
        </div><!-- #content -->
      </div><!-- #primary -->
    
    <?php get_sidebar(); ?>
    <?php get_footer(); ?>

    After that, go to your page, and in the Page Attributes section select Full Width Template

    Thank you.

  8. SuzyB
    Member
    Posted 7 months ago #

    this is great - only one thing more. The text is up against the edge of the content body, I need it set in with a margin of like 20px?
    thanks

  9. Manish Suwal 'Enwil'
    Member
    Theme Author

    Posted 7 months ago #

    Try adding the following code in between <style type="text/css"> and </style> on the above code:

    .hentry {
    margin: 2em;
    }

    You can increase or decrease that margin: 2em; according to your need.

    Any chance you could send me link to the website you're trying to make this work on?
    It would be easy to send you codes.

  10. SuzyB
    Member
    Posted 6 months ago #

    Thanks, that works nicely!

Reply

You must log in to post.

About this Theme

About this Topic