• I have previosly removed my sidebar but would like to have it back, but need some help. Do I change just the sidebar.php?

    Here is the css:

    [Code moderated as per the Forum Rules. Please use the pastebin]

Viewing 7 replies - 1 through 7 (of 7 total)
  • I guess that the code you’ve copied here is the code in page.php?

    The twenty eleven theme does not display the sidebar on pages. You might like to look at:

    Twenty eleven sidebar not shown on all pages

    On the other hand you could try creating a child theme and then, in the child theme just before <?php get_footer(); ?>, add:

    <?php get_sidebar(); ?>

    I’ve no idea what it’ll do. Probably put the layout all to pieces, but you should be able to mess with the CSS to get it to display OK, with a little patience.

    Twenty eleven does display the sidebar on posts. See index.php, which ends:

    ...
        </div><!-- #content -->
      </div><!-- #primary -->
    <?php get_sidebar(); ?>
    <?php get_footer(); ?>

    If you got rid of the sidebar from posts by deleting the call to get_sidebar(), just put it back.

    If you’re messing about with a theme like this, you should always do so in a child theme.

    Cheers

    PAE

    Thread Starter bellaa

    (@bellaa)

    Here is the site: https://www.agilityuken.no

    As you can see I have already messed the theme a bit up (to my liking but still). I did not manage to create a child’s theme and therefore did it in the parents theme (which I know is not exactly the best thing) but it was easier for me.

    I know when I removed the sidebar I did it more than one place, think it wss in the sidebar.php, single, php and style.css.

    I am a bit over my head on this wordpress s*** and could really use some help.

    Is it allowed to ask if anyone could log into my site and help me?

    Why don’t you just reinstall the twenty eleven theme and get back to square one? I take it you have a note of all the changes you made so you can redo the ones you want.

    Now, on the child theme thing… It really is important that you do this. As this experience ought to be telling you, you can really mess up if you change the theme itself. Not that you have, BTW, but it should be showing you the potential for messing up! Not only that, but you have no guarantee that future updates to the twenty eleven theme won’t overwrite your changes if you do them in twenty eleven and not in a child.

    Here’s the minimalist way to create a child theme:

    • Create a new directory in the wp-content/themes directory, named for your theme (let’s call it bellaa)
    • In the directory wp-content/themes/bellaa create an empty file called style.css
    • Edit the file style.css, adding the comments in the code box below to the top of the file (and assuming ‘bellaa’ is going to be the name of your theme)
    • Still editing your style.css file, add a reference to the parent theme’s styles (i.e. the twenty eleven styles) just below the comment block. I’ve also put this reference in the code block below
    • When all is saved, go to your Dashboard –> Appearance –> Themes. You should see your theme listed. Activate it and check your site. It should look just like the parent theme
    • Make any changes you want to your child theme’s styles.css
    • If you need to change any template files, just copy the ones you need to change from the parent theme’s directory into your child theme’s directory and make your changes in the versions in the child theme directory

    Here’s the code that goes at the top of style.css:

    /*
    Theme Name: Bellaa
    Theme URI: https://themeserver.themedomain.whatever
    Description: A child theme for Twenty Eleven by Bellaa
    Author: Bellaa
    Author URI: https://ballaasserver.bellaasdomain.whatever
    Template: twentyeleven
    Version: 0.1
    */
    @import url("../twentyeleven/style.css");

    The only mandatory comment lines are the ‘Theme Name’ and the ‘Template’. The style sheet import is mandatory if you want to use the parent’s styles and there’d be no point in making a child if you didn’t want to do that, really.

    A less minimalist way of creating a child theme is this:

    • Create the child theme directory as above
    • Copy all the files and sub-directories from the parent theme directory into the child theme directory
    • Modify the comment block at the top of the child theme style.css to look like the comment block above
    • Optionally, but sensibly, replace all the style rules in the child style.css with a reference (@import) to the parent style.css, as described above.

    The trouble with this method is that you’re copying loads of stuff into your child that you aren’t going to alter. It’s a waste.

    Whichever way you choose, creating a child theme is so easy, there really is no excuse for not doing it as long as the theme, like twenty eleven, is child theme friendly. As you’re finding out, it can save you a lot of grief.

    So why don’t you just clear the decks and get back to a clean install using twenty eleven? Then create a child theme and then start re-making your changes. You haven’t made a lot of changes so it shouldn’t take long. And you’ll thank me later!

    When you have a clean install, you could post what changes you wanted to make and we could help you to do them in the best way we can collectively think of.

    HTH

    PAE

    Uh! I didn’t address the business you asked about getting someone to log into your site.

    I’ve no idea what the forum rules are, but I imagine that not a few members might feel you were asking for consultancy work on the cheap and that anyone who agreed to do it might be undermining the market. Others, like me probably wouldn’t be too bothered, if at all.

    You’d have to provide a contact method, of course, perhaps via your site, but I guess the moderators would not want to see the forum become an exchange of some sort.

    All this is me guessing, of course. I could be way, way out. If anyone knows what the rules and attitudes are, I’m sure they’ll post to let you know.

    Cheers

    PAE

    Thread Starter bellaa

    (@bellaa)

    I will try what you have posted on how to create a child theme later on today. If I still cant figure it out I guess I will be in need of a consultant, is it possible to accuire that here in that case?

    @bellaa. I don’t think you necessarily need a consultant. That may be the best solution for you, but only you can assess that.

    But I would have thought with the help available here you could do what you wanted as long as you’re a bit patient. And have the time, of course.

    From what I saw of what you’d done so far, I didn’t think the changes looked that large, so going for a consultant just might be overkill.

    Having a clear idea of what you want is probably the most important thing, whether you hire a consultant or not. If you know what you want, you can ask direct questions that are easier for people to answer. Even if the answer might occasionally be, “No”.

    In my limited experience, WP is very flexible and can do most things. Your requirements so far haven’t struck me as being out of the ordinary.

    HTH

    PAE

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Adding sidebar to Twenty eleven theme’ is closed to new replies.