Wordpress Themes - WP Forum at BFA

Wordpress Themes - WP Forum at BFA (http://forum.bytesforall.com/index.php)
-   Montezuma Theme (http://forum.bytesforall.com/forumdisplay.php?f=53)
-   -   Different top padding/margin for content and widget on static page (http://forum.bytesforall.com/showthread.php?t=22182)

Branislav Apr 22, 2014 10:36 AM

Different top padding/margin for content and widget on static page
 
Hello.

My web site is http://www.plavinci.rs

I have created a new main template for the static page with new sub-template for header and a new widget area. The code is below. I have not changed any CSS, other than replace the font with the one that has latin/extended character set.

There is a lot of space between content area and the header, more than between the widget area and the header. I am resolving this for the moment by placing text widget as a first one in the static page widget area and making a few <p> lines, through trial and error, to eaven the space.

The space is too large anyway - I would like the page title to be closer to the header.

What code should I change and in what file?

Thanks

Main template code:

HTML Code:

<?php bfa_get_template_part( 'header2' ); ?>

<div id="main" class="row">
       
        <div id="content" class="col8">
               
                <div id="post-<?php the_ID(); ?>" <?php post_class('cf'); ?>>

            <h1>
                                <a href="<?php the_permalink(); ?>" title="<?php the_title_attribute(); ?>" rel="bookmark"><?php the_title(); ?></a>
                                <?php bfa_comments_number(); ?>
                        </h1>

                        <div class="post-bodycopy cf">
                                <?php the_content(); ?>
                                <?php wp_link_pages( array(
                                        'before' =>
__( '<p class="post-pagination">Pages:', 'montezuma' ),
                                        'after' => '</p>'
                                ) ); ?>
                        </div>

                        <?php edit_post_link( __( 'Edit', 'montezuma' ) ); ?>

                </div>
               
                <?php comments_template( '', true ); ?>
               
        </div>
       
        <div id="widgetarea-fp" class="col4">
                <?php dynamic_sidebar( 'Widget Area Front Page' ); ?>
        </div>
               
</div>

<?php get_footer(); ?>

Sub/template for the header (header2) code:

HTML Code:

<div id="banner-bg" class="cf">
       
    <div id="banner" class="row">
                  <div id="logo-area" class="col5">
                        <<?php bfa_if_front_else( 'h1', 'h3' ); ?> id="sitetitle">
                                <a href="<?php echo home_url(); ?>"><?php bloginfo( 'name' ); ?></a>
                        </<?php bfa_if_front_else( 'h1', 'h3' ); ?>>
                        <p id="tagline"><?php bloginfo( 'description' ); ?></p>
                </div>
                <?php wp_nav_menu( array(
                        'container' =>
'nav',
                        'container_class' => 'menu-wrapper col7',
                        'container_id' => 'menu1-wrapper',
                        'menu_id' => 'menu1',
                        'menu_class' => 'cf menu',
                        'theme_location' => 'menu1',
                        'fallback_cb' => 'bfa_page_menu'
                ) ); ?>
        </div>
    <div id="banner" class="row">
      <img src="http://www.plavinci.rs/wp-content/uploads/2014/04/2012.07.18_17.55.38-Indigo.Hills_.web_.jpg" alt="" width="960" height="250" />
    </div> 
</div>


juggledad Apr 22, 2014 12:28 PM

it looks like the text widget you are using as the top widget, has a couple blank lines in it causing the space.

lmilesw Apr 22, 2014 12:51 PM

You can also adjust the margin of #main with CSS to reduce the space.

Branislav Apr 22, 2014 01:40 PM

Thank you. English is not my native language so I may not have explained properly. The extra lines in the text widget on top are there on purpose. If I do not put it in, the widget area is much closer to the heading than the content area. I like where the widget area sits. I would like the content area to be as close.

I have made a test page at http://www.plavinci.rs/en/test-page/ without the text widget. See how closer the widget is to the heading than the content.

Let me try to adjust #main and see what happens. Thanks again.

Branislav Apr 22, 2014 01:45 PM

Tried reducing the margin in #main, but both the content and the widget go up bz the same amount. The content is still much lower than content.

juggledad Apr 22, 2014 04:19 PM

Try adding this to the end of 'various.css'
HTML Code:

div.page {padding-top: 0px;}
there is currently 30px of top padding so this should move the ceter area up.

Branislav Apr 22, 2014 11:58 PM

I have tried playing with that. See http://www.plavinci.rs/en/test-page/ with it reduced to 2px.

It solves the problem of title being closer to the heading, but both the content area and the widget area have moved up by the same amount, leaving the widget area much closer to the header.

I was thinking that this white space above the page title might be where links to previous and next posts are on the blog posts pages and that somehow this affects static pages as well.

juggledad Apr 23, 2014 04:58 AM

Change the CSS I gave you to this
HTML Code:

div.page.hentry {padding-top: 0px;}
by the way…is the wine any good? :)

Branislav Apr 23, 2014 06:46 AM

This is the right solution! Margin in #main controlls how far both the content area and the widget area are from the head. Changing it moved both areas up and down together by the same distance. Changing . hentry to zero made content area and widget area mutually top-alligned. Thanks. I donated you $20.

The wine. This is my first year. The white has just come back from testing and it got 92 points on sensory. It is very, very fragrant. You would expect it to be sweet, judging by the smell, but it is completely dry. There is actually a bit of astringency in the aftertaste. It has 13,3% alcohol. Not to be drunk in wine bars by itself, but great with heavier, fatty food, including Asian. The red is not ready yet. It is thick, dark, powerfull. Tannins are still sharp and they need to mellow before bottling. Perhaps by Christmas. If not, certainly for next Easter. I am aiming for small production high quality (small in the European sense, less than 1000 cases per year).


All times are GMT -6. The time now is 12:32 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.