Updates from October, 2015 Toggle Comment Threads | Keyboard Shortcuts

  • Jay Versluis 5:44 pm on October 4, 2015 Permalink | Reply
    Tags: , htaccess   

    Categories: How To ( 36 )   

    Apache: How to block all other IPs except for your own 

    Sometimes I have to work on WordPress sites that are too busy to display the admin interface. This can happen if there’s more traffic than the server can cope with. In such cases, we may need to tell every visitor to come back later while we carry out some maintenance.

    But how? Thanks to an Apache command to block all IP addresses, except for our own. We can even display a “maintenance” page while we’re hard at work behind the scenes.

    Let’s see how. Add the following to your .htaccess file in the web root directory, replacing 12.34.56.78 with your own IP address:

    ErrorDocument 403 /maintenance.html
    Order Allow,Deny
    Allow from 12.34.56.78
    

    Save the file on the server and see the site speed up as of by magic. No more requests but your own shall be processed henceforth.

    Thanks to MickeyRush and b101101011011011 for this solution on Stack Overflow:

    How do I find my own IP?

    There are several services that will display the IP you’re currently connecting from. Head over to http://whatsmyip.org, or type “my ip” into Google.

    Does this work with NGINX too

    I’m sure the principle does, but I know very little about NGINX configuration. The above directive is for Apache only. If you know how this works in NGINX, please leave a comment below.





     
  • Jay Versluis 12:23 pm on October 4, 2015 Permalink | Reply
    Tags:   

    Categories: Themes ( 28 ), WordPress ( 145 )   

    How to move the sidebar to the right in TwentyFifteen 

    I’ve never liked themes with sidebars on the left – probably because we in the western world start reading on the left, and I’d like there to be as little clutter as possible. Or perhaps I’m used to navigation items on the right.

    I was looking around for solutions to move the sidebar in Automattic’s TwentyFifteen theme to the right, and several options can be found on the internet. Here are two that worked for me:

    Option 1: CSS Tweak

    Thanks to the Stack Exchange community, this CSS tweak works a treat (for left-to-right languages):

    body:before {
        right: 0;
        left: auto;
    	direction: ltr;
    }
    .sidebar {
        float: right;
        margin-right: auto;
        margin-left: -100%;
    	direction: ltr;
    }
    .site-content {
        float: right;
        margin-right: 29.4118%;
        margin-left: auto;
    	direction: ltr;
    }
    .site-footer {
        float: right;
        margin: 0 35.2941% 0 0;
    	direction: ltr;
    }
    

    Add these declarations to your own TwentyFifteen Child Theme and you’re good to go. If added via a CSS widget or to the bottom of the original theme (which is a really bad idea), additional “!important” statements may be necessary.

    Kudos to toschero and Anteru for the combined solution to this puzzle. Check out the full discussion here:

    Option 2: Pre-made Child Theme

    Ruhul Amin from Tips and Tricks HQ has built a ready-to-use child theme and solved this puzzle in PHP. You can check it out here:





     
c
Compose new post
j
Next post/Next comment
k
Previous post/Previous comment
r
Reply
e
Edit
o
Show/Hide comments
t
Go to top
l
Go to login
h
Show/Hide help
shift + esc
Cancel