• Hello y’all,

    I am having an issue displaying my sidebar on the homepage. I am manually inserting:

    <?php get_sidebar(); ?>

    this is being inserted directly before a loop where my posts (products in my case) are displayed. It is showing in the correct location on the page, but the sidebar is spaced (double/triple) way down the page. If I insert the “get_sidebar” anywhere else, it shows correctly (i.e. the spacing), but isn’t in the proper position. Is there a way to change the text formatting before calling the sidebar, or should am I inserting the code in the wrong place? This website is live and in use, so changes need to be made quickly (esp. on homepage).

Viewing 13 replies - 1 through 13 (of 13 total)
  • Thread Starter graham.guy

    (@grahamguy)

    any tips? Reasons as to why the sidebar is getting double spaced? By double spacing I mean that there are huge gaps between the links… sort of like this:

    example:

    -Home

    -About

    -Categories

    -Links

    -ETC…

    This sounds like a CSS related problem, you’d need to post the link or the Source (the sidebar) from the working page + problem page for an exact solution!

    Thread Starter graham.guy

    (@grahamguy)

    Here’s the main index code… don’t know if it will display properly pasted here.. I need the get_sidebar code after: <div id=”othernews”>

    ::::

    <edit… sorry>
    let me figure out what pastebin is…

    Please don’t post huge chunks of code here. For larger blocks of code, use the WordPress pastebin and post the pastebin url here. It makes life easier for everyone. As it stands, the code from a template file is unlikely to help in this case. Post a link to a page on your site that demonstrates the problem instead.

    Hi,

    For pasting short chunks of code you should put them between backticks to preserve formatting otherwise it will parse some of it, as it suggests below the message box!

    My code here

    I’ve also just read that to paste larger chunks of code it’s helpful if you use WP pastebin Although not 100% sure on how that works!

    Anyhow link to the site would be a lot more helpful, so we can see the problem in action, with the error on the homepage and it working on the other pages!!

    Thread Starter graham.guy

    (@grahamguy)

    On that page where was you putting <?php get_sidebar(); ?>

    Also could you just post up one of the template files where the sidebar is displaying correctly e.g category.php

    Thread Starter graham.guy

    (@grahamguy)

    https://www.accessbiblestudies.com for reference.

    here is the code to search.php:

    <?php get_header(); ?>

    <div id=”content”>
    <?php
    include(TEMPLATEPATH . “/wp-loop.php”);
    ?>
    </div>

    <?php
    get_sidebar();
    ?>

    <?php get_footer(); ?>

    :::

    I was putting the get_sidebar code directly after “Our latest studies…”

    p.s. I still haven’t figured out the ‘backticks’… ?

    Hey,

    The double spacing was appearing because you are probably putting it inside a section which has CSS already defined for lists so it’s overriding it, e.g the other-news section.

    Where did you want the sidebar to appear exactly?

    Make sure you are not putting it in a DIV which is already open.

    So for example if you wanted the sidebar next to the other-news DIV, you could put the sidebar code after the closing DIV for the other-news DIV (which is on line 101 of the paste-bin code).

    After doing this you shouldn’t see the double-spacing, but the sidebar won’t fit in until you adjust the width of either other-news div or the sidebar so there is enough room for them both!!

    Thread Starter graham.guy

    (@grahamguy)

    thanks for your help… i will keep trying to figure this out. I’ve been making a lot of changes to this site, and for something that should be simple, this has stumped me a bit.

    Again, thank you.

    -G

    Any excessive left & right margin on your nav menu links are coming from the CSS on the links themselves in style.css:

    #header li a {
    color:#000000;
    display:block;
    padding:7px 15px 8px;
    }

    Try something like padding:7px 7px 8px; to reduce this spacing.

    Although not 100% sure on how that works!

    @xdesi: The pastebin allows you to post code without escaping it and then just post a link to your script/code. Others can then add amendments using the pastebin itself and post the url of the amended code. Saves cluttering up the forum, makes code much easier to read and rules out the possibility of errors introduced by HTML parsing of the code (eg. the forum still doesn’t cope with ampersands very well even inside backticks).

    @g No problem if you need further clarification don’t be afraid to ask, just let me know where you want the SB to appear!

    @esmi Thanks i didn’t know this, seems like a good option, would be helpful if they suggested this probably under the: Put code in between backticks line below the message textarea.

Viewing 13 replies - 1 through 13 (of 13 total)
  • The topic ‘Sidebar on ‘home’ page’ is closed to new replies.