• The sidebar at https://www.btccaction.co.uk/test/ shows up as totally different to the sidebar at https://www.btccaction.co.uk/btccaction/ which additionally is at the bottom of the page (can’t see why, the stylesheet settings for the sidebar haven’t changed)

    The first link is a page, the second is a post.

    I have a feeling I would need to change some settings to do with

    is_page()

    or

    is_single()

    in order to make the sidebar always show up as in the second example. However I can’t find out where these pieces of code are! Found them in the codex, but not sure where to modify on my website.

    Andy

Viewing 15 replies - 1 through 15 (of 18 total)
  • Try making the width of your comments fields narrower – typically stuff like this has to do with something being too wide in either the main section or the sidebar itself, and since your sidebars are the same, it’s probably the only “different” thing, which would be the comments fields.

    Correction – your sidebar content isn’t the same in both.

    I have a feeling it might be the “Drivers Championship” and other like info that’s doing it…

    Thread Starter andyspeed

    (@andyspeed)

    Maybe it is, but isn’t the sidebar just a php file? It will be capable of holding such information.

    Has anyone else got any ideas as to the problem?

    Thread Starter andyspeed

    (@andyspeed)

    One small sidebar issue has been solved, in that page sidebars are the same as post sidebars

    BUT

    any ideas as to why I have a large white space on this page?

    https://www.btccaction.co.uk/snetterton/

    Again, it’s because the content of your sidebar is too wide, especially when combined with the content of the main content and it’s width.

    This isn’t a new issue – it happens all the time, and this is almost always the problem.

    It has nothing to do with the sidebar being an external php file – it’s the display issues.

    Yeah, looks like you cut and pasted from a word processor… Don’t do that.

    Check:
    https://validator.w3.org/check?verbose=1&uri=http%3A%2F%2Fwww.btccaction.co.uk%2Fsnetterton%2F

    Got bad tags (div’s, li’s, and what the hell is <il>?).

    Thread Starter andyspeed

    (@andyspeed)

    For now I have resolved the problem as there were inconsistencies in the ‘Narrow column’ and ‘Wide column’ properties that made ‘Page’ show up fine and ‘Post not’

    However, thanks Yosemite for the link – I’ll have a sit down and try resolve those issues later.

    <il> was a tag I created to do with my top menu, to make one button a different colour to the rest. Shouldn’t be a problem really.

    Thread Starter andyspeed

    (@andyspeed)

    Once again, I have a sidebar related issue (I’ve done a search and I’m almost embarassed to keep asking questions like this).

    You’ll see I have championship listings down the side. I attempted to extend this to include a couple more tables for additional information. Upon doing this, however, I get the following error:

    “Parse error: parse error, unexpected T_STRING in /home/fhlinux185/r/raceaction.co.uk/user/htdocs/wp-content/themes/fast-lane/sidebar.php on line 103”

    Basically, am I restricted on the amount of data/way data is displayed in the sidebar file?

    No. You are “restricted” to correct code. The error says there is something wrong with whatever php code you have in the sidebar.php. Probably by editing it you messed up what was there and working previously.

    Thread Starter andyspeed

    (@andyspeed)

    Would creating a separate php file with the desired content in, and then putting a adding it through php code into the sidebar work more effectively?

    The error still would be an error.
    Though that solution would help to not tamper with the sidebar’s original code.

    Moderator Samuel Wood (Otto)

    (@otto42)

    www.remarpro.com Admin

    AndySpeed: This is not just “text”. PHP is *executable code*. You don’t get any points for it being “almost correct”.

    Thread Starter andyspeed

    (@andyspeed)

    Then I must ask the question:

    How can I include content, as shown on my site, in the sidebar OR alongside ther other text?

    Perhaps doing away with the original sidebar completely and rewriting my own?

    You can always include any text in your template files in several ways:
    1. editing manually the code and typing the text
    [in this case the only issue might be – especially when using K-clone theme, that the file has a long-long conditional, so if you “break” it, PHP errors will apeear]
    2. using different template tags that generate the desired text/lost etc.
    3. including a text from another file in the theme folder
    [for this case you should use something like:
    <?php include (TEMPLATEPATH . '/yourfile.php'); ?> – copy it literally and change only the filename!]

    Thread Starter andyspeed

    (@andyspeed)

    I created a file, cship.php and used the include as you suggested in the sidebar.

    Same problem. ??

    I don’t really understand what you mean in step 1 though.

    ‘editing manually the code’?

    Thread Starter andyspeed

    (@andyspeed)

    Lets be 100% crystal clear here.

    Here is my sidebar code currently which works.

    When I add (merely extend) the cship.php file, all goes wrong.

    [long code moderated – use a pastebin service for posting long code!]

Viewing 15 replies - 1 through 15 (of 18 total)
  • The topic ‘Changing sidebar’ is closed to new replies.