Forums

Changing sidebar (19 posts)

  1. AndySpeed
    Member
    Posted 3 years ago #

    The sidebar at http://www.btccaction.co.uk/test/ shows up as totally different to the sidebar at http://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

  2. ladydelaluna
    Member
    Posted 3 years ago #

    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...

  3. AndySpeed
    Member
    Posted 3 years ago #

    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?

  4. AndySpeed
    Member
    Posted 3 years ago #

    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?

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

  5. ladydelaluna
    Member
    Posted 3 years ago #

    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.

  6. Yosemite
    Member
    Posted 3 years ago #

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

    Check:
    http://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>?).

  7. AndySpeed
    Member
    Posted 3 years ago #

    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.

  8. AndySpeed
    Member
    Posted 3 years ago #

    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?

  9. moshu
    Member
    Posted 3 years ago #

    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.

  10. AndySpeed
    Member
    Posted 3 years ago #

    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?

  11. moshu
    Member
    Posted 3 years ago #

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

  12. Otto42
    Moderator
    Posted 3 years ago #

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

  13. AndySpeed
    Member
    Posted 3 years ago #

    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?

  14. moshu
    Member
    Posted 3 years ago #

    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!]

  15. AndySpeed
    Member
    Posted 3 years ago #

    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'?

  16. AndySpeed
    Member
    Posted 3 years ago #

    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!]

  17. StefanSuedfeld
    Member
    Posted 3 years ago #

    They are no more different, are they?

  18. AndySpeed
    Member
    Posted 3 years ago #

    No. How can they [the tables] be [written differently]?

  19. ladydelaluna
    Member
    Posted 3 years ago #

    I'm not sure how much more clear it can be explained.

    It has to do with the DISPLAYED RESULTS of what you're putting in the sidebar - regardless of whether you're using PHP, HTML, or some other function, it's the way it's being displayed.

    Test it this way: Make a backup of the sidebar. Then take EVERYTHING out of the sidebar and put in just a regular old paragraph...

    <p>This is just a sentence, and is for testing purposes only.</p>

    Save that up as your sidebar.php and then do a hard refresh (Ctrl + F5) on your site's page.

    I'm 99.999% positive, your sidebar will be back up at the top, with that sentence right up there.

Topic Closed

This topic has been closed to new replies.

About this Topic