WordPress – WebDevLounge http://webdevlounge.com Design, development, SEO and wordpress Thu, 30 Aug 2018 12:49:58 +0000 en-US hourly 1 https://wordpress.org/?v=6.5.2 Crop wordpress medium images to exact size http://webdevlounge.com/crop-wordpress-medium-images-to-exact-size/ Sat, 02 Dec 2017 04:04:00 +0000 http://webdevlounge.com/?p=55

There is no way to crop wordpress medium images to exact size without editing the soure code. If you want to crop wordpress medium images to exact size as specified under Settings -> Miscellaneous -> Medium Size then open wp-includes/media.php in your favourite editor.

Search for line 191:

$newimage = imagecreatetruecolor( $dst_w, $dst_h);

Change $newimage variable to:

$newimage = imagecreatetruecolor( $max_w, $max_h);

Voila, we’re done!

]]>
Upgrading WordPress: Fast, Faster, Fastest http://webdevlounge.com/upgrading-wordpress-fast-faster-fastest/ Thu, 11 Sep 2014 02:16:22 +0000 http://webdevlounge.com/?p=71 Upgrading WordPress is fairly simple, but there can be a few issues, hassles and annoyances if you don’t do it right and if you have more than one WordPress installation, it can become a hassle to keep everything up to date, but there are methods to upgrading WordPress fast.

Before upgrading using any method, a smart blog owner will back up both the files and databases relating to the blog so that if an issue arises, a rollback isn’t too difficult to perform.

FTP

One of the easiest ways to upgrade WordPress is through the use of FTP. This is one of the simplest ways as well, but if you run more than one blog, the upgrade process can start to wear you down as you do the same few steps over and over.

This is much more apparent when WordPress adds new versions often, and you find yourself transferring files on your favourite FTP program more than writing posts on your blog.

One of the biggest mistakes that people make when upgrading WordPress with this method is to not delete the wp-includes and wp-admin folders as files in these folders change from time to time, so overwriting files isn’t good enough as old files will still remain.

More information on upgrading WordPress through FTP

  • WordPress Codex on Upgrading WordPress

Instant Upgrade Plugins for WordPress

There are a few plugins for WordPress that once uploaded, activated and configured correctly, can allow you to easily upgrade WordPress though the WordPress administration panel. Some people recommend these plugins, others warn caution. I haven’t much experience with them because I am very anti-plugin. I would rather use other methods outside of overburdening the plugin architecture in WordPress.

There are two main contenders that I have seen progress in the upgrading of WordPress through a plugin. The first is InstantUpgrade plugin, which allows you to upgrade to either the latest version of WordPress or a version of your own choosing. The second plugin is WordPress Automatic upgrade, which has similar features and function.

I wouldn’t trust either of these plugins with upgrading my blogs because they have had many issues and require file permissions to be really insecure. For me, these plugins are also slower than many other methods as you have to log into each blog to upgrade it, where other options can save you a huge amount of time if you have more than one blog to upgrade each time Automattic releases a new version of WordPress.

Fantastico

Tools like Fantastico De Luxe have made upgrading WordPress a near, one-click upgrade process, but it isn’t without its downsides. The Fantastico package doesn’t immediately get the newest versions of WordPress, and so you might be stuck on an insecure version of WordPress for upwards of a month before the new version shows up in this tool.

The great thing is that Fantastico will take care of making a backup of your current installation, and then install the latest version of WordPress that it has available. I have heard of people having issues with Fantastico, so it is always prudent to back up your blog outside of this tool before running it.

This is one of the fastest ways to upgrade your WordPress blog, and is a great way to manage, and upgrade multiple installs of WordPress quickly and cleanly. Other than the wait time for Fantastico to have the latest versions of WordPress available for upgrading, there aren’t any major downsides that I’ve ever seen.

More Information on Upgrading WordPress through Fantastico

  • Step-by-step Tutorial with Images from Profitblogger

Subversion

One of my favourite ways to upgrade WordPress blogs is through Subversion, also known as SVN, but this method requires a fair bit of technical skill. Especially, if you want to make a Bash script to upgrade all of your blogs from the command line using one command.

Using Subversion, I was able to upgrade over fifty WordPress powered blogs in just a few minutes.

Automattic runs a Subversion server and so if you have Shell access to your web hosting, and they have Subversion installed on it, you can basically drag the latest versions of WordPress down right from Automattic in a very efficient way.

There are many great blog posts on setting your WordPress blog up with Subversion, but one small note from me would be to not install the Trunk version of WordPress as most tutorials would have you do, but instead, pick the most recent stable version and then switch versions as new ones come out.

Trunk is the development code, and can sometimes have errors, or issues, especially since it changes daily.

More information on upgrading WordPress through Subversion

  • WordPress Codex Instructions on Installing WordPress using SVN
  • A Quick Tutorial on Installing/Upgrading using Subversion
  • Instructions on Setting up a Subversion powered WordPress installation

WordPress 2.7

WordPress 2.7 is due out in a few months (most likely October), and will make many of these options nearly obsolete, as it will include the ability to upgrade WordPress from inside the WordPress administration panel, just like the WordPress plugins, except that it will be supported by the people developing WordPress.

Having the upgrade tool built-in means that we will hopefully get an error free way to upgrade WordPress as the developers have access to change the core code to accommodate the upgrade tool they build. I am looking forward to seeing the final result.

WordPress.com

If you are sick and tired of upgrading your WordPress blog, or you are just starting out with WordPress and don’t want to mess with upgrading, then you can always create an account at WordPress.com. This is a hosted blogging site, run by the people that release WordPress. You won’t have to worry about upgrading, as it all happens behind the scenes, allowing you to focus on your blogging.

Conclusion

No matter which way you want to run and upgrade your blog, it is always important to make backups of your work, as well as keep up to date on the software developments, as the worst thing that can happen is a loss of creative work. I have lost far too many articles and don’t wish that on anyone, as they can never be recreated exactly the same as they were.

Enjoy WordPress, and keep it up to date!

]]>
8 easy plugins to install to SEO your WordPress http://webdevlounge.com/8-easy-plugins-to-install-to-seo-your-wordpress/ Sun, 15 Apr 2012 13:17:23 +0000 http://webdevlounge.com/?p=94 This is a very simple guide on which plugins you can install today to increase your blogs performance in the search engine rankings. It’s based on a few years of experience in optimizing WordPress blogs. Some of the blogs I did this on had 50% more traffic from the search engines within 2 weeks!

  1. HeadSpace2
    Headspace2 is one of the two plugins by John Godley that I keep promoting to everyone. Simply install it and use the special tags in the options to change your page titles and meta descriptions to meaningful stuff, make sure the post and page names are the first things in your title, and then your blog name.
  2. Redirection
    The other plugin by John Godley is Redirection. You can use this to redirect old URL’s to new ones, but it has one feature that is my prime reason for using it. It automatically adds a redirect to it’s database when you change a posts slug. So, you can now easily change your post slugs and do not have to worry anymore about search engines and users going to the wrong place.
  3. SEO Friendly Images
    This plugin automatically optimizes ALT and TITLE attributes for each of your images that doesn’t have one. This will make them xHTML valid, and it will also help you a bit in your rankings. Download it here.
  4. SEO Slugs
    SEO Slugs automatically removes words like ‘a’, ‘the’ and ‘in’ and other stop words from your post slugs before saving them, making your URL’s a lot shorter and cleaner, which will improve your chances to rank and improve usability!
  5. Robots Meta
    One of my own plugins, Robots Meta might be a bit impressive on first install. Without going in to all the details here, I’d suggest you at least enable the following options:

    • Prevent indexing of search result pages
    • Prevent indexing of login and register pages
    • Prevent indexing of all admin pages
    • Prevent indexing of author archives
    • Nofollow login and registration links
    • Replace the Meta Widget with a nofollow one
  6. RSS Footer
    Another plugin of mine, RSS Footer will allow you to add a link back to each blog post on your blog in your feed. This way, if scrapers scrape your RSS feed, they will always link back to your original article. Since using this, I’ve come to love scrapers!
  7. Yoast Breadcrumbs
    The last of my plugins, Yoast Breadcrumbs, actually only released this morning, is a plugin to easily add breadcrumb paths to your theme. This is a very good way for your users to navigate around your site, and for search engines to determine the structure of your site. For maximum SEO effect, you should enable the category to show up in your single posts breadcrumbs.
  8. WP Page Numbers
    WordPress’ default pagination is one of the reasons why search engines won’t index older posts, they simply can’t find a post that’s buried 10 clicks away. Using WP Page Numbers, you can change the pagination to use numbers, and link to several pages at once, highly increasing your WordPress SEO.

These tips should help you a lot in improving your rankings. If you want to go even further, read my in-depth article on WordPress SEO, and be sure to start reading my SEO blog.

]]>
WordPress Page Template http://webdevlounge.com/wordpress-page-template/ Tue, 20 Jul 2010 04:46:19 +0000 http://webdevlounge.com/?p=26 Hello Readers,

I am a guest blogger for WebDevLounge. My name is Muhammad Haris and I am here to teach you how can you build custom wordpress page template.

WordPress page template with custom fields is the power to customize wordpress completely. With the combination, you can build different types of systems with WordPress including but not limited to Portfolios and CSS Galleries.

Today, our goal will be to achieve a similar layout like Tom Huveners Work page.

First of all, create a category called “Work”. Remember the ID of the category. Lets assume the category ID is 3 for this tutorial.

Now, create a file called work.php in your theme folder (wp-content/themes/x-theme/work.php) and open it for editing.

Remember, wordpress reads the theme file comments to find the page template. You are required to have the following PHP comment to your page template file otherwise wordpress won’t detect the file as a page template.

<?php
/*
Template Name: Work
*/
?>

No template is completed without header. Next, add get_header(); function to the file for header.

<?php get_header(); ?>

Now, to output all posts only form “Work” category (ID# 3), use query_posts(); function with the famous wordpress loop. Here’s an example.

query_posts('cat=3&posts_per_page=-1');
if (have_posts()) : while (have_posts()) : the_post();
?>
  <div class="site">
		<img src="<?php echo get_post_meta($post->ID, 'image_1', true); ?>" height="162px" width="244px" class="col-1" alt="<?php the_title(); ?>" />
		<img src="<?php echo get_post_meta($post->ID, 'image_2', true); ?>" height="162px" width="244px" class="col-2" alt="<?php the_title(); ?>" />
    <div class="col-3">
      <h3><?php the_title(); ?></h3>
      <?php the_excerpt(); ?>
      <a href="<?php echo get_post_meta($post->ID, 'project_url', true); ?>"><img src="<?php bloginfo('template_url'); ?>/images/open_project.jpg" alt="Open Project" class="open_project" /></a>
    </div>
    <hr />
  </div>
<?php endwhile; ?>
<?php else: ?>
  <p>Sorry, portfolio coming soon!</p>
<?php endif; ?>

The argument within query_posts('cat=3&posts_per_page=-1'); orders it to fetch all posts (posts_per_page=-1) from category ID# 3 (cat=3).

get_post_meta(); function is used to fetch values of custom fields of the post. The function requires 3 arguments post id, key name of the custom field and whether to return the value as a string (true) or array (false).

According to our goal, we need two project images and project url. We added the code to read values of project image #1 key (image_1), project image #2 key (image_2) and project url key (project_url).

Custom fields makes it possible to make different kind of systems with WordPress. If you’re creative, you can think of many ways of using custom fields.

Last but not least, add the following last line to the template.

<?php get_footer(); ?>

We have successfully completed writing our custom page template which can be used for portfolios.

We’re not done yet. We need to use the template.

To use the template, create a page and select “Work” from the dropdown list. There is no limitation for page title and permalink. You can even add content to it through admin panel.

Now, you need to add content to your newly created page.  Here are the steps to be followed:

  1. Add a title.
  2. Add content.
  3. Select “Work” from the Category.
  4. Jump to Custom Fields.
  5. Add Image 1 custom field. Key: image_1 Value: Your project first image URL.
  6. Add Image 2 custom field. Key: image_2 Value: Your project second image URL.
  7. Add Project URL custom field. Key: project_url Value: Your project URL.
  8. Click Save or Publish (depending upon your choice).
  9. Smile!

Voila! We’re done. I hope you like my very first tutorial. I am going to keep writing tutorials. If you don’t understand any part of the tutorial, please comment and I’ll help you out.

]]>