• Resolved connectto

    (@connectto)


    hello

    heres my link https://www.connectto.com.br/websites/connectto/

    im using wordpress with 2 colunms (content + right sidebar)

    i updated my pages, so now i have my right sidebar also there – in the whole website, not only in index

    the only problem is, in my homepage the sidebar is ok, but in internal pages the sidebar have an empty space above search (widget area) ..

    so how can i fix this to have sidebar in pages exactly in same position of my index ?

    initialy i think about find the correct css and move this area up, but, will this move the area in my homepage also, ? i need to move only in the internal pages …

    anyopne can help about this please ?

    thanx

Viewing 9 replies - 1 through 9 (of 9 total)
  • quick question, did you modify the page.php file? The sidebar does’t seem to be in the right place compared with index.php.

    Thread Starter connectto

    (@connectto)

    yes i follow this steps to add sidebar to page https://www.transformationpowertools.com/wordpress/twenty-eleven-sidebar-on-single-posts-and-pages

    found it here in this forum – worked great – but dont know how to remove the space above widgets

    already tried to move the code to other positions in page.php but didnt worked

    if anyone know a solution, please help ! thanx ??

    you must have missed a step in my tutorial, as there is still the .singular class in your posted page;

    as you have opted to use a copy of the theme instead of a child theme, the changes can be made directly in functions.php;

    adapt this section in functions.php (at the very end):

    function twentyeleven_body_classes( $classes ) {
    
    	if ( function_exists( 'is_multi_author' ) && ! is_multi_author() )
    		$classes[] = 'single-author';
    
    	if ( is_singular() && ! is_home() && ! is_page_template( 'showcase.php' ) && ! is_page_template( 'sidebar-page.php' ) )
    		$classes[] = 'singular';
    
    	return $classes;
    }
    add_filter( 'body_class', 'twentyeleven_body_classes' );

    change the one line to:

    if ( ! is_home() && ! is_page_template( 'showcase.php' ) && ! is_page_template( 'sidebar-page.php' ) )

    (untested)

    Thread Starter connectto

    (@connectto)

    uou thanx alchymyth you alllways rock !

    i just need a help – i dont think if i really understood correctly

    do i need to substitute this whole piece of code:

    function twentyeleven_body_classes( $classes ) {

    if ( function_exists( ‘is_multi_author’ ) && ! is_multi_author() )
    $classes[] = ‘single-author’;

    if ( is_singular() && ! is_home() && ! is_page_template( ‘showcase.php’ ) && ! is_page_template( ‘sidebar-page.php’ ) )
    $classes[] = ‘singular’;

    return $classes;
    }
    add_filter( ‘body_class’, ‘twentyeleven_body_classes’ );

    substitute with this one line code :

    if ( ! is_home() && ! is_page_template( ‘showcase.php’ ) && ! is_page_template( ‘sidebar-page.php’ ) )

    or i need to substitute just part of the code ?

    i try top substitute the whole piece of code, but didnt work,

    didnt understood exactly what means “change the one line to:” – the original piece of code that you show above have more than one line.. which one should i substitute ?

    Thread Starter connectto

    (@connectto)

    ok i think i understood which line should i replace…

    so i did replace the line

    ———————————-

    if ( is_singular() && ! is_home() && ! is_page_template( 'showcase.php' ) && ! is_page_template( 'sidebar-page.php' ) )

    ——————————–

    with this line

    ——————————–

    if ( ! is_home() && ! is_page_template( 'showcase.php' ) && ! is_page_template( 'sidebar-page.php' ) )

    ———————————

    but actually didnt work

    also tried to just add the extra line of code so i get this

    ————————————

    function twentyeleven_body_classes( $classes ) {
    
    	if ( function_exists( 'is_multi_author' ) && ! is_multi_author() )
    		$classes[] = 'single-author';
    
    	if ( is_singular() && ! is_home() && ! is_page_template( 'showcase.php' ) && ! is_page_template( 'sidebar-page.php' ) )
    		$classes[] = 'singular';
    
    	if ( ! is_home() && ! is_page_template( 'showcase.php' ) && ! is_page_template( 'sidebar-page.php' ) )
    
    	return $classes;
    }
    add_filter( 'body_class', 'twentyeleven_body_classes' );

    ————————————

    but also didnt work…

    [Please post code or markup snippets between backticks or use the code button. Your posted code may now have been permanently damaged by the forum’s parser.]

    my mistake – on closer inspection, just removing the mentioned line should work;

    i.e. that section should just look like:

    function twentyeleven_body_classes( $classes ) {
    
    	if ( function_exists( 'is_multi_author' ) && ! is_multi_author() )
    		$classes[] = 'single-author';
    
    	return $classes;
    }
    add_filter( 'body_class', 'twentyeleven_body_classes' );
    Thread Starter connectto

    (@connectto)

    well now my widget area is under my main content https://www.connectto.com.br/websites/connectto/

    yesterday i did some modifications in style.css in order to make the width of page content similar to home width

    its like this now

    ——————————–

    .left-sidebar.singular #content {
    margin: 0 -15%;
    position: relative;
    width: 120%;
    }

    ———————————

    it worked fine yesterday, now i try to change this values to see if this is the problem and it seems to be irrelevant – it seems that the new function.php settings make this item on css irrelevant

    anyway – i can see that my left margin of page conteant is ok – so the only problem it seems to be the position of widget – it seems that i can even put the old values again in this piece of css, now the problem with page.php left margin its ok, i think thats because of the function.php modifications

    donty know if my modifications in style.css .left-sidebar.singular #content are the reason that made function.php settings dont work well

    im just explaining here to try to help find where is the problem hehe

    anyway, anyone can help ? it seems to be really near to fix this..

    sorry bad english, sometimes is dificult to explain what i want to say.. thanx

    your sidebar seems to inserted too early:
    – the line:
    <?php get_sidebar(); ?>
    needs to be just before the line:
    <?php get_footer(); ?>

    (both in page.php and single.php)

    Thread Starter connectto

    (@connectto)

    thanx alchymyth

    without this forum i dont know what could i do , really thanx

Viewing 9 replies - 1 through 9 (of 9 total)
  • The topic ‘space above widgets only in pages’ is closed to new replies.