Wordpress Themes - WP Forum at BFA
There will be no more development for Atahualpa (or any other theme), and no support. Also no new registrations. I turned off the donation system. I may turn the forum to read only if it gets abused for spam. Unfortunately I have no time for the forum or the themes. Thanks a lot to the people who helped in all these years, especially Larry and of course: Paul. Take care and stay healthy -- Flynn, Atahualpa developer, Sep 2021

Wordpress Themes - WP Forum at BFA » WordPress Themes » Montezuma Theme »

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


  #1  
Old Apr 22, 2014, 11:36 AM
Branislav
 
7 posts · Apr 2014
naer Belgrade, Serbia
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>

Last edited by juggledad; Apr 22, 2014 at 01:23 PM.
  #2  
Old Apr 22, 2014, 01:28 PM
juggledad's Avatar
juggledad
 
23,765 posts · Mar 2009
OSX 10.11.5 WP 4.x Atahualpa(all) Safari, Firefox, Chrome
it looks like the text widget you are using as the top widget, has a couple blank lines in it causing the space.
__________________
"Tell me and I forget, teach me and I may remember, involve me and I learn." - Benjamin Franklin
Juggledad | Forum Moderator/Support
  #3  
Old Apr 22, 2014, 01:51 PM
lmilesw's Avatar
lmilesw
 
10,176 posts · Jul 2009
Central New York State USA
You can also adjust the margin of #main with CSS to reduce the space.
__________________
~Larry (CNY Web Designs)
This site should be a membership site since it so full of good stuff.
Please consider donating which gives you access to even more good stuff.
  #4  
Old Apr 22, 2014, 02:40 PM
Branislav
 
7 posts · Apr 2014
naer Belgrade, Serbia
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.
  #5  
Old Apr 22, 2014, 02:45 PM
Branislav
 
7 posts · Apr 2014
naer Belgrade, Serbia
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.
  #6  
Old Apr 22, 2014, 05:19 PM
juggledad's Avatar
juggledad
 
23,765 posts · Mar 2009
OSX 10.11.5 WP 4.x Atahualpa(all) Safari, Firefox, Chrome
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.
__________________
"Tell me and I forget, teach me and I may remember, involve me and I learn." - Benjamin Franklin
Juggledad | Forum Moderator/Support
  #7  
Old Apr 23, 2014, 12:58 AM
Branislav
 
7 posts · Apr 2014
naer Belgrade, Serbia
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.
  #8  
Old Apr 23, 2014, 05:58 AM
juggledad's Avatar
juggledad
 
23,765 posts · Mar 2009
OSX 10.11.5 WP 4.x Atahualpa(all) Safari, Firefox, Chrome
Change the CSS I gave you to this
HTML Code:
div.page.hentry {padding-top: 0px;}
by the way…is the wine any good?
__________________
"Tell me and I forget, teach me and I may remember, involve me and I learn." - Benjamin Franklin
Juggledad | Forum Moderator/Support
  #9  
Old Apr 23, 2014, 07:46 AM
Branislav
 
7 posts · Apr 2014
naer Belgrade, Serbia
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).

Bookmarks

Tags
margin top, padding, static page



Similar Threads
Thread Thread Starter Forum Replies Last Post
Need sidebar text widget to contain (static) content for each page. jms5017 Sidebars & Widgets 3 Aug 20, 2011 03:21 PM
Widget Content padding / margin quentinjs Sidebars & Widgets 5 Oct 16, 2010 02:59 PM
Problems setting padding-left to the content area in widget with tag-cloud kathari Sidebars & Widgets 0 Jan 18, 2010 02:14 PM


All times are GMT -6. The time now is 12:48 AM.


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