WordPress Tips, Tutorials and Plugins

I thought I would put together a quick list of tips, tutorials and plugins that I have found useful recently.

1. Getting Thumbnail Images working in WordPress Multisite:

Something that really baffled me over the last week is missing post thumbnails in my WordPress Multisite Install. After searching high and low I finally found the solution. To enable post thumbnails simply navigate to Network Admin (top right hand corner) and then to Settings.  Within Settings tick the check box for Image Uploads. You may then need to navigate to Screen Options (top right hand corner again) and tick the check box for Featured Image. This will also enable the small image icon above the WYSIWYG used for adding images into the post itself. Video etc can also be enabled in the same place.

2. Mixing together custom post types in listing

So you’ve created several post types, one for portfolio items, one for products etc etc but instead of displaying them on their own individual listing pages you need to mix them together in the same loop and order by date… Here is the answer. Place the below code before your loop to query the custom post types you require.

1
2
3
4
5
6
7
query_posts( array(
'post_type' => array(
'custom-post-type-portfolio',
'custom-post-type-products',
),
'paged' => $paged ) // for paging
);

3. How to use a plugin in your template if only a shortcode is provided

As soon as I download a plugin I search through the documentation to find the template tag. Maybe its a bit old school but I prefer to add plugins into my templates so that I can place them exactly where I want, configure them as I need and style around them. But sometimes all your provided with is a shortcode. These can be turned into template tags by following these instructions.

Functions.php

1
<span>add_<span>shortcode</span>('<span>shortcode</span>_name', 'template_tag');</span>

Your template

1
<span>echo do_<span>shortcode</span>("[<span>plugin</span>_<span>shortcode</span>_here]");</span>

4. Multiple Content Blocks
Something that has always bugged me about WordPress is the inability to split page content into manageable CMS chunks. Yes you can create custom fields and custom sidebars but what happens when there is a whole block of content that you would like the user to have WYSIWYG editing control over? The answer is this plugin Multiple Content Blocks It does exactly what it says on the tin and transforms WordPress into a functional CMS much along the lines of Drupal and CMS Made Simple. Love it!

5. Popular posts & Related Posts
Its pretty popular these days to have a section on a site displaying the most popular post or related posts. My all time favourite plugins for this are by Rob Marsh. Simple and easy to configure Robs plugins although slightly old these days still provide the best configuration options and are easy to template and style.

Comments

  1. Hi Hannah, thanks so much for tip #1 – saved me a lot of pain!

    lostumbrellas - 08 Jun 2011
  2. Hey, Hannah. Thanks for posting tip #1. I was like to lose all my hair. You rock. :)

    Matthew Stumphy - 19 Aug 2011
  3. +1 Coder Karma.

    Thanks, you saved me a good hour of digging.

    Dan Imbrogno - 13 Sep 2011
  4. thanx for tip 1! you’re a life saver!

    al-ex - 17 Oct 2011
  5. #1 dont work on 3.5.1 maybe someone can help?

    Elvis - 10 Mar 2013

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>