Performancing Metrics

Posts Tagged ‘Code’

5 Keys for a Successful Site Redesign

Design ImageThe time has come and it can’t be put off any longer. You need to update your site’s look (and hopefully you have more than five hours to do it in).

Whether your existing theme isn’t compatible with newer versions of your content management system (CMS), your layout isn’t isn’t capable of keeping up with what you want to do next with your site or your existing look has grown too dated, the decision to redesign a site is never easy.

Not only is it a great deal of work to create a new theme, but your readers, even if they don’t realize it, have likely become familiar and comfortable with it. As Facebook has shown us repeatedly, even small changes can lead to user revolts if you take your visitors out of their comfort zone.

So you do you prevent a site redesign from taking on a life of its own and becoming either a technical or a user nightmare? Obviously, planning is key but how you plan and what you plan is the difference between a relatively painless transition to a disaster that sets your site back months or years.

With that in mind, here are five of the biggest keys to focus on when you’re looking to redesign your site. Read More

Categories: General
Tags: , , , , , , , ,

Blogging Pitfalls: Why You Need to Know HTML & CSS

Keyboard ImageIt wasn’t that long ago that starting up a website required a great deal of expertise, time and commitment. There was a reason that those who created sites in the early days of the Web were stereotyped as “dorks” and “nerds”, it was because you had to know HTML, the ins and outs of site construction and at least a decent amount about how the Web worked just to get a basic site off the ground.

However, for Web development, the march of technology has been toward simplicity and ease of use. Blogging and Web publishing in general are both more approachable than ever. Not only can one set up a Facebook account in minutes but they can do the same with a WordPress.com account or a Tumblr blog as well.

In short, anyone who wants to publish a blog can easily do so and almost no experience is required, just the ability to fill in a short form and write some new content.

But this doesn’t mean we’ve gotten away from HTML and CSS being a requirement for creating a successful site. Not knowing these languages can be very detrimental to your site and not only keeps great content from finding the audience it deserves, but can actually cripple your site in ways you can’t predict.

Simply put, if you don’t know HTML and CSS, at least to a minimal extent, you are holding your blog back and gambling with its future.

Read More

Categories: Blog Design, Blogging Resources, Blogging Tips, WordPress Themes
Tags: , , , , , , ,

Display Upcoming Entries In Your Post With A WordPress Shortcode

Since some days several contacts have been considering the option to display upcoming posts on their site. WordPress offers a really simple solution for this in the form of the attribute post_status. The post_status is stored in the wp_post table and has generally the attributes: draft, private, publish or static for pages. There is one more attribute which we will use in this example: future.

It is now simple to create a list of the 5 upcoming entries and display this in your theme, fe. in your sidebar.

<?php
$my_query = new WP_Query('post_status=future&showposts=5');
?>
<div class="sidebar-box">
    <?php
    if ($my_query->have_posts()) : while ($my_query->have_posts()) :
        $my_query->the_post();
        ?>
        <ul>
          <li>
           <?php the_title(); ?>
          </li>
        </ul>
    <?php endwhile; else: ?>
        <div>
        <ul>
          <li><?php _e('No upcoming Posts'); ?></li>
        </ul>
        </div>
    <?php endif; ?>
</div>

You can now easily style this in your CSS.

Use A Shortcode To Display Upcoming Entries In A Post

First, what are shortcodes? I wrote a small intro to shortcodes on Devlounge yesterday with some examples of how to build a shortcode.

Why would you want to display a list of upcoming posts within an entry? You could be writing a series and want to use your upcoming entries as an additional teaser in the hope that the reader will subscribe or return to your site. You could use a post template for this but it is very simple to create a shortcode. Once you have created this shortcode it is then very simple to add the list of upcoming posts anywhere in an entry.

Building the shortcode

For this example we are going to build a shortcode [upcoming] and will use the tag series as selector. Doing this, it will avoid that scheduled entries not tagged Series will not be displayed. This can be handy on multi-authored blogs with a regular, scheduled posting rhythm.

Add the following code to your functions.php.

function upcom($atts, $content = null) {
       extract(shortcode_atts(array(
               "num" => '5'
               "tag" => 'series'
       ), $atts));
       global $post;
       $myposts = get_posts('numberposts='.$num.'&post_status=future&order=DESC&orderby=date&tag='.$tag);
       $retour='<ul class="upcoming">';
       foreach($myposts as $post) :
               setup_postdata($post);
            $retour.='<li><a href="'.get_permalink().'">'.the_title("","",false).'</a></li>';
       endforeach;
       $retour.='</ul> ';
       return $retour;
}
add_shortcode('upcoming', 'upcom');

All you have to do now to display this list in an entry is use the shortcode [upcoming] in the editor.

In this example I used <ul class="upcoming"> to easily style the output in your CSS.

Modifying The Shortcode Function

The shortcode function above can easily be modified.

- The example returns 5 posts, change the value in line 3 to display more or less entries
– Change the tag you want to use in the same way as you would change the number of displayed entries (line 4).

Categories: WordPress Tips, WordPress Tutorials
Tags: , , ,