How to force image to link directly to file

I recently updated my WordPress version to 3.5.1 and noticed an issue with all images linking to an attachment page by default instead of the image file. This is a known bug with WordPress where the link=”file” is not being added in the gallery shortcode, despite the Link To being set to Media. (see http://core.trac.wordpress.org/ticket/23298#no1)

There is however a work around, you can edit the media.php file to permanently link images to their original file and never use an attachment page although when you next update WordPress, the changes will be lost so make a note just incase (hopefully they would have fixed this issue by then anyway!).

Details
WP Version: 3.5.1
File: wp-includes/media.php
Line: 780
Code: $link = isset($attr[‘link’]) && ‘file’ == $attr[‘link’] ? wp_get_attachment_link($id, $size, false, false) : wp_get_attachment_link($id, $size, false, false);

Posted in WordPress Notes and Tips
Leave a comment

Is the new Google Panda Update good for business?

Looks like Google is at it again, the internet is set for another algorithm update to cut down on websites producing duplicate and miss leading content. Up until now websites or webpages that get a lot of click-throughs gain a high page ranking in the search engines regardless of content relevance, however the new Google Panda Update is set to change this. Page rankings will be calculated on user statistics, for example if a page gets a lot of click-throughs, its page ranking would be calculated on the amount of time users spend on that page to make it relevant rather than just a bunch of clicks.

At least this way we are less likely to have to click-through loads of webpages to find what we’re looking for and we’ll be reading content that other users have found particularly interesting and relevant.

Further Reading:

eCommerce sites urged to clean up content before Google’s ‘Panda’ goes global

Posted in Search Engine Optimisation
Leave a comment

WordPress error on upload

Sometimes I find an issue when uploading files or images to WordPress via the admin area. It may say; “the uploaded file could not be moved to…” or “HTTP error”, I have narrowed this down to 3 potential possibilities:

  • If you have added a custom permalink you may need to add the following code to the .htaccess file in the root:
  •     <IfModule mod_rewrite.c>
            RewriteEngine On
            RewriteBase /
            RewriteRule ^index\.php$ - [L]
            RewriteCond %{REQUEST_FILENAME} !-f
            RewriteCond %{REQUEST_FILENAME} !-d
            RewriteRule . /index.php [L]
        </IfModule>
        <IfModule mod_security.c>
            SecFilterEngine Off
            SecFilterScanPOST Off
        </IfModule>
  • File permissions may need changing on the FTP, you can do this by right clicking and choosing ‘Set Permissions’ on the folder in remote view.
  • If the website was moved from the Localhost to the live web server, the paths may need changing in the database via phpmyadmin.
  • Website has run out of disk space or bandwidth.

Please remember that these are only solutions for problems that I have come across and hopefully will work for you as well.

Posted in WordPress Notes and Tips
Leave a comment

WordPress Notes and Tips

I find it is good practice to make notes on common issues that you come across in WordPress. This will save time in the future when trying to remember what you did before to fix that problem. I have compiled a list of my design notes in this blog (coming soon) to assist with WordPress development. Any other ideas I have left out, feel free to let me know.

Posted in WordPress Notes and Tips
Leave a comment

Can One Stylesheet Fix All?

This is an interesting question that I have pondered over for a long time, can one stylesheet really fix all cross browser compatibility issues?

Recently I worked collaboratively on a web application that needed to be compatible with IE6 users, as well as all the others and although I was tempted to use the old IF IE fix, I decided to stick with one stylesheet. Using various tips and tricks I successfully fixed all IE cross browser compatibility issues thus making the web app appear the same across all the popular browsers.

I would say that if you have a more complex layout and you want everything to be pixel perfect then it may be necessary to use the IF IE fix.

I will be writing a list of popular IE browser issues and their fixes, so check back again soon.

Posted in Cross Browser Compatibility
Leave a comment

Marks Design Blog

Welcome to my design blog where I discuss design best practices, web design trends and basically all things related with design. Feel free to get involved with any discussions you feel strongly about (no swearing please!), everyone is entitled to an opinion.

Posted in Uncategorized
Leave a comment