Site logo

Archived topic

Remove .site-content padding in a template

4 replies · Started by Sigve on July 12, 2017

Viewing posts 1–5 of 5

Hello,

Is there any way for me to remove the 40px paddding for one template only?

I know I can use the "Page Builder Container" and put it on "Full Width", but I have a lot of pages using this template. Therefore I am looking for a solution where I would not need to do this for all new pages using this template.

Website: https://sushiportalen.no/restauranter/alex-sushi-solliplass

(I am trying to get the images fullwidth on top of each restaurantpage)

Any way to fix this with some PHP or CSS?

Thanks!

Here is the template:

<?php
/**
 * Template Name: single-restauranter
 *
 */

if ( ! defined( 'ABSPATH' ) ) exit;

get_header(); ?> 

<div id="primary" <?php generate_content_class();?>>
<main id="main" <?php generate_main_class(); ?>>

<?php do_action('generate_before_main_content'); ?>
<?php while ( have_posts() ) : the_post(); ?>

<article id="post-<?php the_ID(); ?>" <?php post_class(); ?> <?php generate_article_schema( 'CreativeWork' ); ?>>
<div class="inside-article">
<?php
$name = get_field('navn'); 
$address = get_field('adresse');
$zipCode = get_field('postnummer');
$area = get_field('poststed');
$phone = get_field('telefon');
$logo = get_field('logo');
$description = get_field('beskrivelse');
$website = get_field('nettside');
$district = get_field('bydel');
?>
<div class="hero">
<img src="//ap.mnocdn.no/images/a60bb5c9-b641-4183-a1dc-da8cd8624e9a?fit=crop&h=1152&q=80&w=2048" class="one">
<img src="//ap.mnocdn.no/images/714be871-b0ec-4efb-a1de-3188ddb372d2?fit=crop&h=576&q=80&w=1024" class="two">
<img src="//ap.mnocdn.no/images/c702a848-60a3-4582-800a-68ba64a808f5?fit=crop&h=576&q=80&w=1024" class="three">
</div>

<h1><?php echo($name);?></h1>
<p><?php echo($description);?></p>
<p><a href="<?php echo($website);?>">Nettside</a></p>
<p><?php echo($district);?></p>
<p><i class="fa fa-fw fa-map-marker" aria-hidden="true"></i><?php echo($address . ', ' . $zipCode . ' ' . $area);?></p>
<p><i class="fa fa-fw fa-phone" aria-hidden="true"></i><?php echo($phone);?></p>

<?php 
  echo(build_mapa($name, $address, $zipCode, $area));
?>

<?php 
$post_id = $post->ID;  
if( $post_id ) {            
    echo do_shortcode( '[WPCR_SHOW POSTID="' . $post_id . '" PAGINATE="1" PERPAGE="8" SHOWFORM="1" HIDEREVIEWS="0" HIDERESPONSE="0"]' );
}
?>
	
<?php
wp_link_pages( array(
			'before' => '<div class="page-links">' . __( 'Pages:', 'generatepress' ),
			'after'  => '</div>',
		    ) );
?>

<?php do_action( 'generate_after_entry_content' ); ?>
<?php do_action( 'generate_after_content' ); ?>
</div><!-- .inside-article -->
</article><!-- #post-## -->

<?php endwhile; // end of the loop. ?>
<?php do_action('generate_after_main_content'); ?>
</main><!-- #main -->
</div><!-- #primary -->

<?php 
do_action('generate_sidebars');
get_footer();

Try this:

.one-container.single-restauranter .site-content {
    padding: 0;
}

Thanks a lot, that worked!
I just had to add max-width:100%; to make it full width.

.one-container.single-restauranter .site-content {
    padding: 0;
}

.one-container.single-restauranter .grid-container {
    max-width:100%;
}

Cool, glad I could help! :)

This archived topic is closed to new replies.