WordPress IS a CMS and WordPress SHOULD be taken seriously

For a while now (in fact quite a while) I’ve found that time after time within the web industry I’ve had to backup and support WordPress as a serious CMS contender.

It’s amazing to find so many so-called experts who believe that it’s not capable of do this, that or the other.  Or “it’s just a blog tool”, etc, etc.

Please people open your eyes!  WordPress is probably now the most popular CMS ever created to date (think it’s now betting Joomla?), its powering millons of sites and in particular only 6-8% are using it as a blogging tool.  Yep that’s right, the other 92% use it as a full-blown CMS – whether it’s for ecommerce, intranet, community, DMS or other!!

Anyway, enough of my moaning and groaning.  The clever people at Moove have provided a great infographic to say it all.  Launched in July, I can’t believe I’ve only seen this now!

WordPress in Numbers Infographic 2013

WordPress Home Page trick

When creating WordPress sites for clients, they often require a home page that needs updating but mainly feed from other pages e.g. news, carousels, etc.

Using a full “page” is often OTT as they’ll never create large amounts of content – sometimes it’s just a welcome message.

A great way to set this up then, is to use an over-ride for the default home page (you don’t even need to set to static page or alike).  To do this, simply create a front-page.php page in your template folder and viola – you can now set up your page as you want using your favourite text editor.

Using front-page.php I then add the carousels shortcode, custom code to bring in posts, etc.  As well as create some home-page specific widget areas for the homepage – allowing the editor to still have freedom to add/remove and customise content to produce a regular updated home page.

You could also use home.php but WordPress tends to think this is a variant of index.php and really used for display blogs.  WordPress will look for home before index.

Removing unwanted WordPress widgets from editor panel

I often find that most of my clients who use WordPress don’t use most of the standard widgets – often because they are using it as a CMS and not a heavy duty Blog.

A lot of the standard widgetst are features for comments, archives and a like.  A while ago I came a function in WordPress that you can use to unregister (and thus hide) these from the WordPress interface for your clients.  I’ve used it for a while but completely forgot until I needed to use it again recently.  So to help others (you lot probably already knew! lol) here’s the code:

As a heads up – you simply drop this into your functions.php in the theme you’re running.

// unregister all widgets
 function unregister_default_widgets() {
     unregister_widget('WP_Widget_Pages');
     unregister_widget('WP_Widget_Calendar');
     unregister_widget('WP_Widget_Archives');
     unregister_widget('WP_Widget_Links');
     unregister_widget('WP_Widget_Meta');
     unregister_widget('WP_Widget_Search');
     unregister_widget('WP_Widget_Text');
     unregister_widget('WP_Widget_Categories');
     unregister_widget('WP_Widget_Recent_Posts');
     unregister_widget('WP_Widget_Recent_Comments');
     unregister_widget('WP_Widget_RSS');
     unregister_widget('WP_Widget_Tag_Cloud');
     unregister_widget('WP_Nav_Menu_Widget');
     unregister_widget('Twenty_Eleven_Ephemera_Widget');
 }
 add_action('widgets_init', 'unregister_default_widgets', 11);

 

Show “Latest” blog entry on page

Ever wanted to put your latest blog post or maybe even latest 3) on your WordPress home page or maybe another “content” page in your site?  Well here’s a quick snippet of code which allows just that!

You can set how many “latest” blog posts you want (to change the amount just change the number in the entry get_posts(#)) and if you don’t want the full blog content, simply change the_content() to the_excerpt() for the short version;


               
              
                
 

Useful WordPress navigation code

For most of my WordPress websites I tend to use an old but superb plugin called “Fold Page List” – this improves the standard WordPress navigation by showing child pages only when in a particular section! Perfect!

But what if I didn’t want to show the “whole navigation” on the left hand side when I went into section?!?!  Well as far as I can see I needed to create/use something custom.

So a search on Google came up with a few results but nothing really seemed to really do what I wanted, until I came across this post from TammyHart Designs – and it worked out perfect!

Made a few tiny tweaks to make sure the code validated so here’s  my reworked code (kudos to TommyHart for the original start though!):

<?php if ( is_page() ) { ?>
            <?php
                if($post->post_parent)
                    $children = wp_list_pages('title_li=&child_of='.$post->post_parent.'&echo=0'); else
                    $children = wp_list_pages('title_li=&child_of='.$post->ID.'&echo=0');
                    if ($children) { ?>

                    <h2><?php $parent_title = get_the_title($post->post_parent); echo $parent_title; ?></h2>
                    <ul>
                        <?php echo $children; ?>
                    </ul>
            <?php } ?>
        <?php } ?>

Still not perfect as I only want to show grand-children pages when you click on the child page – exactly what Fold Page list does – so looks like I’ll be doing a tweak to that involving the above really soon 😉