WordPress.org

Ready to get started?Download WordPress

Forums

Sidebar help (11 posts)

  1. bellablack
    Member
    Posted 8 years ago #

    I am not sure if this is the place to ask, but here it is. I am not good with coding and such so forgive me if I sound dumb. I was just wondering if there is a way for me to have one sidebar file for all my themes that way when I need to edit something I only have to edit one file instead of 5 different ones for all my themes. My side bar is pretty much the same for all my themes except for maybe the size (wxh) but other then that they all have the same info. I use my wordpress for more of a site then a blog so this would be easier for me. So If there was a way for everything except the size info could be held in one file instead of 5 that would be awesome. I am not sure how to do this so if someone could help I would appreciate it! Thanks!

  2. resiny
    Member
    Posted 8 years ago #

    hm. There might be a way, but it's beyond me.

    Anyone?

  3. bellablack
    Member
    Posted 8 years ago #

    thanks resiny. silly.

  4. Silkjaer
    Member
    Posted 8 years ago #

    you can do a manual php include instead of using the standard sidebar include call.. :)

  5. bellablack
    Member
    Posted 8 years ago #

    how do i do that? remember i don't know?! what would the coding look like. this is my sidebar.php file:

    [moderated the long code!-
    use a pastebin service]

  6. moshu
    Member
    Posted 8 years ago #

    Or, if you are 100% sure the content part of those sidebars is the same...

    you can just make a file where you put

    search tag
    archive tag
    category tag
    meta etc.

    and include that one in every sidebar.php - in between the div tags that define the layout.
    I've never tried but I think it should work.

  7. bellablack
    Member
    Posted 8 years ago #

    so what would the exact code look like? i don't know how to write it?!

  8. moshu
    Member
    Posted 8 years ago #

    Unless somebody sees all the five sidebar files... it's impossible to tell.

  9. bellablack
    Member
    Posted 8 years ago #

    ok all the sidebar files are exactly the same (view here: http://pastebin.com/582717 )except for line 5 which is the size.

  10. bellablack
    Member
    Posted 8 years ago #

    anymore help?!

  11. moshu
    Member
    Posted 8 years ago #

    That's not the usual theme structure, for sure...
    So, no, no help: it is too much risk involved in this kind of "remote" redesigning/restructuring a theme.

    I for one wouldn't feel comfortable giving any further remote advice (on the top of what I did above) if the user has no basic coding knowledge. Sorry. It would break her blog 100 times and I don't want to be blamed for that.

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags