This thread is over two years old and may be outdated. Please create a new thread if you need help, or email us if you have an active Premium license.

Custom template content on left side

Resolved 7 replies premiumthemetheme-vantage

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.

Need fast email support? Get SiteOrigin Premium

Replies

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

    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>
    </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. Greg Priday Staff 10 years, 2 months ago

    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. Krištof Kelecsényi 10 years, 2 months ago

    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. Support Assistants 10 years, 2 months ago

    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. Support Assistants 10 years, 2 months ago

    Thanks. Try adding to Appearance > Custom CSS:

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

    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.

Have a different question or issue?

Start New Thread