Archive for category: how-tos

Connection Information

To perform the requested action, WordPress needs to access your web server. Please enter your FTP credentials to proceed. If you do not remember your credentials, you should contact your web host.

I’ve seen this far too many times on WordPress sites, and for a long time struggled with the solution.  I finally figured it out and since I use it without trouble every time now, I simply have to share.  While there are many things that could cause the error, in all the cases I’ve experienced, it’s been a problem with the owner of the WordPress files on the Apache server.  So the solution involves connecting to the site through SSH.  Navigate to your wordpress directory.

  1.  Find out who the web user is on your copy of apache by running this command: ps aux | egrep ‘(apache|httpd)’
    You should get a list of files and their owner, and the most common owner name will be what you want to use.  It’s probably something like ‘apache’ or ‘www-data’ or ‘root’, but for this purposes of this explanation, I will assume it is ‘www-data’.
  2. Assuming your wordpress installation is in an htdocs folder, the first thing you want to do is reset the ownership of all the wordpress files to this web user:
    chown -R www-data htdocs/
  3. Maybe not required, but you can also change the group ownership of all the wordpress files:
    chgrp -R www-data htdocs/
  4. And finally, give full privilege for the directory:
    chmod u+wrx htdocs/*

Hopefully you, like me, will now magically have back the ability to keep WordPress automatically updated again!

So, here’s the situation.  I have a bunch of images, and each image has a larger version and some rich text content to go with it, that needs to be opened in a modal window.  All the related content for each image sits within the page, so I need to use inline content.  I am also using Colorbox for the modal window.  I had a hellofva time finding an appropriate tutorial and example for this online.  A lot of people are trying to do similar things, but there’s either no solution or what they want isn’t close enough to what I’m trying to accomplish.  Every photo needs to have its own link AND still be in a prev/next slider once the modal opens.

After a lot of trial and error, I figured out how to do it.  So here goes:

THE HTML

For your links themselves:

  <a href="#preview1" class="preview">Preview 1</a>
  <a href="#preview2" class="preview">Preview 2</a>
  <a href="#preview2" class="preview">Preview 3</a>

For the inline content boxes:

<div style="display:none">
    <div id="preview1" rel="previewBox">
          <div>Awesome HTML Content</div>
    </div>
    <div id="preview2" rel="previewBox">
          <div>Awesome HTML Content</div>
    </div>
    <div id="preview2" rel="previewBox">
          <div>Awesome HTML Content</div>
    </div>
</div>

THE JAVASCRIPT

<script type="text/javascript">

  $(document).ready(function() {

    $(".preview").colorbox({
      open:false,
      inline:true,
      html: function() {
          var div = $(this).attr('href'); return $(div).html();
      },
      href: $(this).attr('href'),
      rel: 'previewBox'
    });

  });

</script>

Anyway, here’s hoping this saves someone some time! This was done successfully with Colorbox 1.3.17.2 and jQuery 1.4.1.