Home>Support>Custom template content on left side

Custom template content on left side

Notice: This thread is over two years old; the information may be outdated. Please consider creating a new thread if you require free support. If you have an active SiteOrigin Premium license, you can email our premium support desk at [email protected].

hello,

I made a custom tempalte for my Custom post type using the template-full.php. But the content is not using the whole screen as it should, it is loading on the left side and is not centered. How do make it centered?

my code is as follows
Thanks guys

This is our free support forum. Replies can take several days. If you need fast email support, please purchase a SiteOrigin Premium license.

  1. 9 years, 7 months ago Krištof Kelecsényi

    Again did not loaded my code. I think it is a problem on the forum

     
    <?php
    /**
     * This template displays full width pages.
     *
     * @package vantage
     * @since vantage 1.0
     * @license GPL 2.0
     * 
     * Template Name: Soutěže-Jaro
     */
    
    get_header(); ?>
    
    
    
    
    
      <div id="primary" class="content-area">
        <div id="content" class="site-content" role="main">
    
    
    
        <header class="entry-header">
          <h1 id="jaro" class="entry-title"> <?php the_title(); ?> </h1>
          
        </header><!-- .entry-header -->
    
    
    <?php 
    
    wp_reset_postdata();
    
     $args = array('post_type' => 'jaro' );
     $query = new WP_Query( $args );
    
    ?>
    
    
    
    
    
    <?php if( $query-> have_posts() ) : while ( $query->have_posts() ) : $query->the_post(); ?>
    
     <?php $date = DateTime::createFromFormat('Ymd', get_field('datum')); ?>
    
    <div id="bg" class="row">
    <a href="#" data-toggle="modal" data-target="#<?php the_field('datum'); ?>">
    
    
    <div class="col-xs-2">
    <h2><?php echo $date->format('d.m.Y'); ?> </h2>
    </div>
    <div class="col-xs-6">
    <h2><?php the_title(); ?> </h2>
    </div>
    
    <div class="col-xs-4">
    <?php the_field('mesto'); ?>
    
    
    
    
    
    </div> <!-- div s bootstrapem -->
    </a>
    <br><br>
    </div><!-- #content .row -->
    
     <!-- Modal -->
      <div class="modal fade" id="<?php the_field('datum'); ?>" role="dialog">
        <div class="modal-dialog">
        <!-- Modal content-->
          <div class="modal-content">
            <div class="modal-header">
              <button type="button" class="close" data-dismiss="modal">×</button>
              <h3 class="modal-title"><?php echo $date->format('d.m.Y'); ?> - <?php the_title(); ?></h3>
            </div>
            <div class="modal-body">
            <div class="row">
            <div class="col-xs-6">
            <h2>Odpovědný zástupce organizátora:</h2>
    <?php the_field('ozo'); ?> 
    
    
    </div>
    <div class="col-xs-6">
    <h2>Místo konání:</h2>
     <?php the_field('misto'); ?> 
    
    
    </div>
    </div> <!-- .row v modalu -->
           <div class="modal-footer">
              <button type="button" class="btn btn-default" data-dismiss="modal">Zavřít</button>
            </div>
          </div>
          
        </div>
      </div>
    </div>
    
    
    
    <?php endwhile; endif; wp_reset_postdata(); ?>
    
    
        </div><!-- #content .site-content -->
      </div><!-- #primary .content-area -->
    
    <?php get_footer(); ?>
    
    
      
    
    
    
  2. 9 years, 7 months ago Greg Priday
    Hi, I Work Here

    Hi Krištof

    To implement this, you’d need to add a little more custom CSS to force the full width.

    body.single-post-type-slug #primary {
      width: auto;
      float: none;
    }
    

    Where you’d replace post-type-slug with the slug for your post type. Hopefully that does the trick :)

  3. 9 years, 6 months ago Krištof Kelecsényi

    Dear Greg,

    I does not work. And i tried it also on normal pages {not custom post types} and even there it did not worked.

    What i mean the locator does not work. Because i put inside background-color:black !important; and nothing changed….

    Is there a different approach i could use?

    Thanks

  4. 9 years, 6 months ago Support Assistants

    Hi Krištof

    Do you have a public URL where we can take a look at what’s going on? If you need to keep this URL private from other users, just select “Private Reply” on the bottom right of the comment box.

  5. 9 years, 6 months ago Krištof Kelecsényi

    Dear,

    It is http://adventurersdiary.net/jaro-2016/

  6. 9 years, 6 months ago Support Assistants

    Thanks. Try adding to Appearance > Custom CSS:

    .page-template-template-jaro #primary {
    	float: none;
    	width: auto;
    }
  7. 9 years, 6 months ago Krištof Kelecsényi

    Thaks !
    That did the job ;]

Replies on this thread are closed. Please create a new thread if you have a question, or purchase a SiteOrigin Premium license if you need one-on-one email support.

Get The Most Out of SiteOrigin with SiteOrigin Premium

Find Out More