Support » Themes and Templates » Adjusting Twentytwelve theme

  • I have a site:
    I need to
    a) reduce the red space at the top of all the pages.
    b) add a login feature on all pages for members so they can access the Members (Only) area. The rest of the site will be public.
    c) I modified the original style.css before I understood child themes. Is there a way to revert to the original style theme css but move all the changes to the child theme?
    thanks in advance!

Viewing 5 replies - 1 through 5 (of 5 total)
  • a) .site-header {
    padding: 13px 0;
    /* padding: 1.714285714rem 0; */

    b) You probably can add a widget for this to the sidebar.

    c) I doubt it, but no worries, if you continue working on your site, you will keep making changes. You could make a child theme now, apply it and when you update you will see what to do. – my2ct.

    Axel13, Thanks!
    a) still needs to be higher but now that I know where to look will play with it.
    b) found the widget ‘Sidebar Login’ which does the first part. Now I have to workout how to lock the ‘Members’ pages from view unless logged in.
    c) Worst case is I’ll back up the style.css when I finish. Just copying the complete style.css then adding my other changes to it would work, I think?

    a) (y)

    b) There are plugins that even allow you to hide parts of pages and to add a login, or a mention that “this section is only visible to…”.
    I forgot which one I tried, but it looks like you have plenty of options:

    In WordPress you can also hide content for unlogged users through php with this function.

    You can also add it like this:

    <?php if ( is_user_logged_in() ) { ?>
    content or menu item or anything added via php
    <?php } ?>

    So, you could basically make a new content page (template), embed the content with the php, add another block with f.ex. and show this one to the unlogged users. This is done (I think) with adding an !


    <?php if (! is_user_logged_in() ) { ?>
    This content is only visible to our members. Please login or join us.
    <a href="">[login]</a> -- ( I didn't test that)
    <?php } ?>

    c) I’m not a fan of child themes. In fact, I’m currently making my first and feel it is confusing. You always have to keep the code in mind that you don’t see. When making changes, you must actively undo stuff, which probably also makes the load heavier. So, I would recommend to always back up everything and not to worry about it.

    Additionally, I think an is missing in your footer. I would suggest to change this to something more like this:

    <div class="site-info">
    	<a href="" title="Semantic Personal Publishing Platform">WordPress Powered</a> - Copyright: <?php echo date("Y"); ?> ©  <a href="<?php echo get_bloginfo( 'url' )?>" title="<?php echo get_bloginfo( 'name' )?>">Shanghailanders</a>

    Note, in the second code block I refer to a site, with some code to create a login form, which you could add to that page… I wasn’t thinking about the fact that it would be posted as code 🙂

    I’m not a fan of child themes. In fact, I’m currently making my first and feel it is confusing.

    Then please do not encourage people to edit the main theme. Your confusion with creating your first child theme should not be a reason for you to give others poor advice.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Adjusting Twentytwelve theme’ is closed to new replies.