Inerd Hussein - tagged with wordpress http://www.ooopx.net/feed en-us http://blogs.law.harvard.edu/tech/rss Sweetcron husseinad@gmail.com 10 Handy WordPress Comments Hacks http://www.ooopx.net/items/view/3245/10-handy-wordpress-comments-hacks

 

Comments sections are neglected on many blogs. That is definitely a bad thing, because comments represent interaction between you and your readers. In this article, we’ll have a look at 10 great tips and hacks to enhance your blog’s comments section and give it the quality it deserves. You may be interested in the following related posts:

5 Useful And Creative Ways To Use WordPress Widgets Power Tips For WordPress Template Developers 10 Useful WordPress Loop Hacks Custom Field Hacks For WordPress 15 Useful Twitter Hacks and Plugins For WordPress Mastering WordPress Shortcuts 100 Amazing Free WordPress Themes For 2009

  1. Add Action Links To Comments

The problem. Whether or not you allow readers to add comments without having to be approved, you will often need to edit, delete or mark certain comments as spam. By default, WordPress shows the “Edit” link on comments (using the edit_comment_link() function) but not “Delete” or “Spam” links. Let’s add them. The solution. First, we have to create a function. Paste the code below in your functions.php file: function delete_comment_link($id) { if (current_user_can('edit_post')) { echo '| <a href="'.admin_url("comment.php?action=cdc&c=$id").'">del</a> '; echo '| <a href="'.admin_url("comment.php?action=cdc&dt=spam&c=$id").'">spam</a>'; } } Once you have saved functions.php, open up your comments.php file, and add the following code where you want the “Delete” and “Spam” links to appear. They must go in the comment loop. In most themes, you’ll find an edit_comment_link() declaration. Add the code in just after that. delete_comment_link(get_comment_ID()); Code explanation. The first thing we did, of course, was to make sure the current user has permission to edit comments. If so, links to delete and mark a comment as spam are displayed. Note the use of the admin_url() function, which allows you to retrieve your blog admin’s URL. Source:

How to: Add “Delete” and “Spam” buttons to your comments.

  1. Separate TrackBacks From Comments

The problem. Do your posts have a lot of TrackBacks? Mine do. Trackbacks are cool because they allow your readers to see which articles from other blogs relate to yours. But the more TrackBacks you have, the harder the discussion is to follow. Separating comments from TrackBacks, then, is definitely something to consider, especially if you do not use the “Reply” capabilities introduced in WordPress 2.7. The solution. Open and edit the comments.php file in your theme. Find the comment loop, which looks like the following: foreach ($comments as $comment) : ?> // Comments are displayed here endforeach; Once you have that, replace it with the code below: <ul class="commentlist"> <?php //Displays comments only foreach ($comments as $comment) : ?> <?php $comment_type = get_comment_type(); ?> <?php if($comment_type == 'comment') { ?> <li>//Comment code goes here</li> <?php } endforeach; </ul>

<ul> <?php //Displays trackbacks only foreach ($comments as $comment) : ?> <?php $comment_type = get_comment_type(); ?> <?php if($comment_type != 'comment') { ?> <li><?php comment_author_link() ?></li> <?php } endforeach;

</ul> Code explanation. Nothing hard about this code. The get_comment_type() function tells you if something is a regular comment or a TrackBack. We simply have to create two HTML lists, filling the first with regular comments and the second with TrackBacks. Source:

Jamie asks: How do I display comments and TrackBacks separately?

  1. Get Rid Of HTML Links In Comments

The problem. Bloggers are always looking to promote their blogs, and spammers are everywhere. One thing that totally annoys me on my blogs is the incredible amount of links left in comments, which are usually irrelevant. By default, WordPress transforms URLs in comments to links. Thankfully, if you’re as tired of comment links as I am, this can be overwritten. The solution. Simply open your function.php file and paste in this code: function plc_comment_post( $incoming_comment ) { $incoming_comment['comment_content'] = htmlspecialchars($incoming_comment['comment_content']); $incoming_comment['comment_content'] = str_replace( "'", '&apos;', $incoming_comment['comment_content'] ); return( $incoming_comment ); }

function plc_comment_display( $comment_to_display ) { $comment_to_display = str_replace( '&apos;', "'", $comment_to_display ); return $comment_to_display; }

add_filter('preprocess_comment', 'plc_comment_post', '', 1); add_filter('comment_text', 'plc_comment_display', '', 1); add_filter('comment_text_rss', 'plc_comment_display', '', 1); add_filter('comment_excerpt', 'plc_comment_display', '', 1); Once you have saved the file, say goodbye to links and other undesirable HTML in your comments. Code explanation. The first thing we did was create two functions that replace HTML characters with HTML entities. Then, using the powerful add_filter() WordPress function, we hooked the standard WordPress comments processing functions to the two functions we just created. This makes sure that any comments added will have their HTML filtered out. Sources:

How to: get rid of links in your comments How to disable HTML in WordPress comments

  1. Use Twitter Avatars In Comments

The problem. Bloggers find Twitter very useful because it allows them to promote their blog and stay connected to other bloggers and their own audience. Because of Twitter’s popularity, why not illustrate comments with Twitter avatars instead of the normal gravatars? The solution.

The first thing to do is get the functions file here. Once you have that, unzip the archive to your hard drive, and then open the twittar.php file. Select all of its content and paste it to your blog’s functions.php file. The last thing to do is open your comments.php file and find the comments loop. Paste the following line in the comments loop: <?php twittar('45', 'default.png', '#e9e9e9', 'twitavatars', 1, 'G'); ?>

Code explanation. Some months ago here at Smashing Magazine, an awesome plug-in named Twittar was released. Its purpose is to allow you to use Twitter avatars on your WordPress blog. Because of the number of requests I received from WpRecipes.com readers, I decided to turn the plug-in into a hack, for people who prefer hacks to plug-ins. Of course, you could simply install the plug-in rather than insert its content into your function.php file. It’s up to you. Sources:

Twitter avatars in comments How to: Use Twitter avatars in comments

  1. Set Apart Author Comments With Style

The problem. For blog posts that have a lot of comments, finding the author’s comments and responses to reader questions is not always easy, especially if the blog don’t have WordPress 2.7’s threaded comments feature. Happily, it is possible to give author comments a different style so that readers can always quickly find your answers. The solution.

Open the comments.php file and find the comment loop: <?php foreach comment as $comment) { ?>

After that line, paste in the following: <?php $isByAuthor = false; if($comment->comment_author_email == get_the_author_email()) { $isByAuthor = true; } ?>

Once that’s done, find the line of code that represents comments (it may vary depending on your theme): <li class="<?php echo $oddcomment; ?>" id="comment-<?php comment_ID() ?>">

Now we have to output the authorcomment class if the comment was made by the author: <li class="<?php echo $oddcomment; ?> <?php if($isByAuthor ) { echo 'authorcomment';} ?>" id="comment-<?php comment_ID() ?>">

The last thing we do is create a CSS class for author comments. Open the style.css file and insert the code. Replace the example colors with your colors of choice. .authorcomment{ color:#fff; font-weight:bold; background:#068; }

Code explanation. Basically, this code compares each email address left by a commentator to the author’s email address. If they match, the $isByAuthor is set to true. When comments are displayed on screen, the value of $isByAuthor is checked. If it returns true, then the authorcomment class is added to the container. It can be done more easily on Wordpress 2.7+ by just adding comment_class(); to the comment’s DIV, which automatically adds the class bypostauthor when you’re commenting on your own post (Thanks, Nima!). Source:

Highlight Author Comments in WordPress

  1. Display Total Number Of Comments And Average Number Of Comments Per Post

The problem. On your blog’s dashboard, WordPress tells you how many total comments your blog has received. Unfortunately, there’s no function for displaying this information publicly. Displaying the total number of comments on your blog and average number of comments per post can be very helpful, especially if you have a page for advertising opportunities. The solution. <?php $count_posts = wp_count_posts(); $posts = $count_posts->publish;

$count_comments = get_comment_count(); $comments = $count_comments['approved'];

echo "There's a total of ".$comments." comments on my blog, with an average ".round($comments/$posts)." comments per post."; ?> Code explanation. Introduced in version 2.5, the wp_count_posts() and get_comment_count() functions allow you to easily retrieve the total number of posts and comments, respectively, on your WordPress blog. To derive the average number of comments per post, we have to do a bit of simple math, using the PHP round() function to make sure we end up with an integer. Source:

How to: Display your average number of comments per posts

  1. Display X Number Of Most Recent Comments

The problem. By default, WordPress provides a widget that outputs a list of however many of the most recent comments. This is great, but sometimes you want this functionality without a widget. The solution. This hack is very simple: just paste this code wherever you need a certain number of the most recent comments to be displayed. Don’t forget to specify the actual number on line 3 (after the LIMIT SQL clause). <?php $pre_HTML =""; $post_HTML =""; global $wpdb; $sql = "SELECT DISTINCT ID, post_title, post_password, comment_ID, comment_post_ID, comment_author, comment_date_gmt, comment_approved, comment_type,comment_author_url, SUBSTRING(comment_content,1,30) AS com_excerpt FROM $wpdb->comments LEFT OUTER JOIN $wpdb->posts ON ($wpdb->comments.comment_post_ID = $wpdb->posts.ID) WHERE comment_approved = '1' AND comment_type = '' AND post_password = '' ORDER BY comment_date_gmt DESC LIMIT 10";

$comments = $wpdb->get_results($sql); $output = $pre_HTML; $output .= "\n<ul>"; foreach ($comments as $comment) { $output .= "\n<li>".strip_tags($comment->comment_author) .":" . "<a href=\"" . get_permalink($comment->ID)."#comment-" . $comment->comment_ID . "\" title=\"on ".$comment->post_title . "\">" . strip_tags($comment->com_excerpt)."</a></li>"; } $output .= "\n</ul>"; $output .= $post_HTML; echo $output; ?> Code explanation. As in the last hack, we use the $wpdb object here, too, this time with the get_results() method. Once the comments have been retrieved by the WordPress database, we simply use a for loop to concatenate the comments into an HTML unordered list. The $pre_HTML and $post_HTML variables, initialized at the top of this code, allow you to define which content should go before and after the comments list. Sources:

How to: List most recent comments Huge Compilation of WordPress Code

  1. Easily Prevent Comment Spam

The problem. Comment spam is such a pain for everyone. Akismet is a good solution, but why not block spammers outright instead of just marking their comments as suspected spam? This code looks for the HTTP referrer (the page where the request comes from) and automatically blocks the comment if the referrer is incorrect or not defined. The solution. Paste the following code in your functions.php file: function check_referrer() { if (!isset($_SERVER['HTTP_REFERER']) || $_SERVER['HTTP_REFERER'] == “”) { wp_die( __('Please enable referrers in your browser, or, if you\'re a spammer, bugger off!') ); } }

add_action('check_comment_flood', 'check_referrer'); That’s all. Once you’ve saved the file, your blog will have a new level of protection against spam. Code explanation. This code automatically rejects any request for comment posting coming from a browser (or, more commonly, a bot) that has no referrer in the request. Checking is done with the PHP $_SERVER[] array. If the referrer is not defined or is incorrect, the wp_die function is called and the script stops its execution. This function is hooked to WordPress’ check_comment_flood() function. This way, we can be sure that our check_referrer() function is called each time a comment is posted. Source:

Yoast.com

  1. Keep WordPress Backwards Compatible With Versions Older Than 2.7

The problem. Released some months ago, WordPress 2.7 introduced a totally new commenting system, allowing you to thread comments and display them on separate pages. Although this is great, keep in mind if you are creating a theme for a client or for online distribution that many users still haven’t upgraded their installation to version 2.8 or even 2.7. This code allows 2.7+ users to benefit from the new commenting system, while keeping the old system functional for people with older versions. The solution. You’ll need two files for this recipe: the first is a WordPress 2.7 compatible comments file called comments.php. The second is a comment template for older WordPress versions called legacy.comments.php. Both of these files go in your theme directory. Paste this code in your functions.php file. <?php add_filter('comments_template', 'legacy_comments');

function legacy_comments($file) { if(!function_exists('wp_list_comments')) : // WP 2.7-only check $file = TEMPLATEPATH.'/legacy.comments.php'; endif; return $file; } ?> Code explanation. This code creates a function called legacy_comments(), which is hooked to WordPress comments_template function. Each time WordPress calls comments_template(), our legacy_comments() function is executed. If the wp_list_comments() function doesn’t exist, the code automatically loads legacy.comments.php instead of comments.php. Sources:

Making your theme’s comments compatible with WordPress 2.7 and earlier versions How to: make your comments template compatible with WordPress 2.7 and older versions

  1. Display Most Commented Posts From A Certain Period

The problem. Number of comments is a good way to measure a blog post’s popularity and is a good filter for displaying a list of your most popular posts. Another great idea is to restrict a list of your most popular posts to a particular period, like “Last month’s most popular posts,” for example. The solution. Simply paste the following code where you’d like your most commented posts to be displayed. Don’t forget to change the dates values on line 3 according to your needs. <ul> <?php $result = $wpdb->get_results("SELECT comment_count,ID,post_title, post_date FROM $wpdb->posts WHERE post_date BETWEEN '2009-06-01' AND '2009-07-01' ORDER BY comment_count DESC LIMIT 0 , 10");

foreach ($result as $topten) { $postid = $topten->ID; $title = $topten->post_title; $commentcount = $topten->comment_count; if ($commentcount != 0) { ?> <li><a href="<?php echo get_permalink($postid); ?>"><?php echo $title ?></a></li> <?php } } ?> </ul> Code explanation. The first thing we did was send out an SQL query to the WordPress database using the $wpdb object. Once we got the results, we used a simple PHP foreach statement to display the most popular posts from a certain period in an HTML unordered list. Source:

How to: Display the most commented posts of 2008

Related posts You may be interested in the following related posts:

5 Useful And Creative Ways To Use WordPress Widgets Power Tips For WordPress Template Developers 10 Useful WordPress Loop Hacks Custom Field Hacks For WordPress 15 Useful Twitter Hacks and Plugins For WordPress Mastering WordPress Shortcuts 100 Amazing Free WordPress Themes For 2009

About the Author This guest post was written by Jean-Baptiste Jung, a 27-year-old blogger from Belgium, who blogs about WordPress at WpRecipes, about practical Web development tips at Cats Who Code and about Photoshop and Web design at PsdVibe. You can stay in touch with Jean by following him on Twitter. (al)

© Jean-Baptiste Jung for Smashing Magazine, 2009. | Permalink | 59 comments | Add to del.icio.us | Digg this | Stumble on StumbleUpon! | Tweet it! | Submit to Reddit | Forum Smashing Magazine

Post tags: comments, CSS, hacks, twitter, wordpress

]]>
Thu, 23 Jul 2009 02:31:00 -0600 http://www.ooopx.net/items/view/3245/10-handy-wordpress-comments-hacks
9 Useful Snippets for Your WordPress Functions http://www.ooopx.net/items/view/2895/9-useful-snippets-for-your-wordpress-functions

Seeing as how the WordPress category is one of the most successful and popular categories on Themeforest, it seems fit to cover some useful tips on the topic. When it comes to WordPress, many designers seem to be scared off or uninterested in the functions.php file, when really it can be one of the most useful files for your WordPress theme. Today, we will review nine superb code snippets you can use to enhance your theme. One of the biggest benefits of the functions.php file, is that it allows us some abstraction from our regular theme files. Instead of hard coding information or queries into, say, our single.php file, we can use our functions.php file instead to alter it. Later on down the road, if we need to make any changes, we can simply edit one file instead of many. 1. Make Your Theme Widget Ready A widget ready sidebar could almost be consider essential for any Wordpress theme. Widgets allow the end user to easily and quickly customize specific content on their WordPress theme. Luckily for us, making our sidebar widget ready is very simple. First, add the below code to your functions.php file:

if ( function_exists('register_sidebar') ) register_sidebar(array( 'before_widget' => '<li class="widget">', 'after_widget' => '</li>', 'before_title' => '<h2 class="widgettitle">', 'after_title' => '</h3>', ));

The code above registers our sidebar widgets and formats them with some basic HTML markup, this allows the designer to easily use those elements to style the widgets and page as they see fit. Now, all we need to do is add a conditional php statement in our sidebar, like so:

<?php if ( !function_exists('dynamic_sidebar') || !dynamic_sidebar() ) : ?> <!--non widget and sidebar information go here-->   <?php endif; ?>

Our theme is now widget ready, if there are no widgets enabled, the default sidebar information will be displayed. If the widgets are enabled by the user, then the widgets will be displayed along with any markup that we declared in our functions.php file. 2. Add Multiple Sidebar Widgets What if we wanted to have multiple sidebars or sections for other widgets to be added? This is very similar to the code above, however, we need to let WordPress know we are going to register multiple sidebars. We can achieve this easily by doing something like the below snippet:

<?php if ( function_exists('register_sidebar') ) register_sidebar(array('name'=>'-ColumnOne', 'before_widget' => '<li class="widget">', 'after_widget' => '</li>', 'before_title' => '<h2 class="widgettitle">', 'after_title' => '</h3>', )); register_sidebar(array('name'=>'-ColumnTwo', 'before_widget' => '<li class="widget">', 'after_widget' => '</li>', 'before_title' => '<h2 class="widgettitle">', 'after_title' => '</h3>', )); ?>

The only other thing we would need to do is add our additional conditional statement like we did in Step 1:

<?php if ( !function_exists('dynamic_sidebar') || !dynamic_sidebar('-ColumnOne') ) : ?> <!--Default sidebar info here--> <!--do the same thing for -ColumnTwo --> <?php endif; ?>

Additional Resources:

Codex: WordPress Widgets and Dynamic Sidebars Creating multiple sidebars in WordPress

  1. Promote Your RSS Feed After Individual Articles You may have noticed that many blogs have a little bit of self promotion that occurs at the end of their articles. Such promotion usually contains things like encouraging you to subscribe to RSS feeds or maybe a list of related posts. Using our functions.php file, we can automatically append a little bit of self promotion onto the end of our individual articles.

<?php function promote_blog($content){ echo $content; if(is_single()){ ?> <div class='promote'> <h3>Enjoy this article?</h3> <p>Consider <a href="<?php bloginfo('rss2_url'); ?>" title="Subscribe via RSS">subscribing to our RSS feed!</a></p> </div> <?php } } add_filter('the_content', 'promote_blog'); ?>

You could easily add any additional classes or divs you need and style away. Below is a great example of promoting ones website after the individual article using WordPress by WP Engineer:

  1. Enable Adsense Shortcode This tip comes from the WordPress expert, Jean-Baptiste Jung, from his article on Smashing Magazine. Basically, wordpress allows developers and theme creators to write functions that allow the user to use shortcode, i.e., [adsense]. This kind of ‘pseudo’ code makes it easy for end users to insert elements where they would like without knowing about coding. Knowing that we can create shortcodes, we can create one to insert a Google Adsense ad anywhere in theme theme.

function showads() {
return '<div id="adsense"><script type="text/javascript"><!--
google_ad_client = "pub-XXXXXXXXXXXXXX";
google_ad_slot = "4668915978";
google_ad_width = 468;
google_ad_height = 60;
//-->
</script>
  <script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script></div>';
}
  add_shortcode('adsense', 'showads');

Now whenever you would like to add your adsense code in your articles or pages, just simply insert [adsense]. Article Source 5. Add a ‘Send to Twitter’ Link With TinyURLs in the Status If you’re on Twitter and want to give users the option of sending the current article to their status with your link (in the form of a TinyURL) and post title, you can add this custom function to your functions.php file. As noted, credit to my friend Brian Cray for the one line TinyURL solution:

if(!function_exists('dd_tiny_tweet_init')){   function dd_tiny_tweet_init($content){ //Thanks to http://briancray.com for the one line $tiny_tweet_url solution. $tiny_tweet_url = file_get_contents('http://tinyurl.com/api-create.php?url=' . urlencode('http://' . $_SERVER['HTTP_HOST'] . '/' . $_SERVER['REQUEST_URI'])); //Grab the title of the current post $tiny_tweet_title = get_the_title(); //Reduce title to 100 characters $tiny_tweet_title = substr($tiny_tweet_title, 0,100); //Append an ellipsis to the end $tiny_tweet_title .='...'; //Set up the status and url to send to twitter $tiny_tweet_status_url = 'http://twitter.com/home?status=Currently reading "'.$tiny_tweet_title."\" ".$tiny_tweet_url; //If the current page is an individual article, promote it with a Twitter link! if(is_single()){ $content .= '<div class=\'tiny_tweet\'>Enjoy this post? <a href=\''.$tiny_tweet_status_url.'\'>The give it a tweet!</a></div>'; } return $content; } add_filter('the_content', 'dd_tiny_tweet_init');   }

Note you will need to make sure your host supports file_get_contents() for this to work. Below is a screenshot of the basic output:

The comments in the code above should explain most of it. When a user views an individual article, they can click on the link to send the article to their current Twitter status. If our article was named ‘Hello World’, then the status would read: Currently reading ‘Hello World…’ http://tinyurl.com/5ng3n8 Customize and style to your liking and you have a fully functioning send to Twitter link! 6. Disable Commenting on Posts Older Than 1 Month Sometimes blog conversations can get a little off topic and out of hand to say the least. If you wish to keep things relative and up to date on the latest discussions, you cal close comments automatically after one month. This handy tip comes to us from forthelose and looks like so:

<?php   function close_comments( $posts ) {   if ( !is_single() ) { return $posts; }   if ( time() - strtotime( $posts[0]->post_date_gmt ) > ( 30 * 24 * 60 * 60 ) ) { $posts[0]->comment_status = 'closed'; $posts[0]->ping_status = 'closed'; }   return $posts; } add_filter( 'the_posts', 'close_comments' );   ?>

You can find a nice example of this on the website of Elliot Jay Stocks:

  1. Add a PayPal Donation Link Perhaps you run a website or blog that likes to give away free tutorials, images, and/or code and you would like to offer your readers a way to give back. Using a custom PayPal url and function, we can automatically create a shortcut code to create a donation link. All credit to Blue Anvil for this wonderful snippet:

function donate_shortcode( $atts ) { extract(shortcode_atts(array( 'text' => 'Make a donation', 'account' => 'REPLACE ME', 'for' => '', ), $atts));   global $post;   if (!$for) $for = str_replace(" ","+",$post->post_title);   return '<a class="donateLink" href="https://www.paypal.com/cgi-bin/webscr?cmd=_xclick&business='.$account.'&item_name=Donation+for+'.$for.'">'.$text.'</a>';   } add_shortcode('donate', 'donate_shortcode');

Next, just replace the ‘text’ and ‘account’ values with your own within this function. Now all you need to do is add the shortcode wherever you like in your post, i.e. [donate]

  1. Change the Default Gravatar Our next tip comes to us from CatsWhoCode and is a simple option to change the default WordPress gravatar with one of your own. This is a fantastic way to further brand yourself and your website.

if ( !function_exists('fb_addgravatar') ) {   function fb_addgravatar( $avatar_defaults ) {   $myavatar = get_bloginfo('template_directory').'/gravatar.gif'; //default avatar below $avatar_defaults[$myavatar] = 'Exciting new gravtar';   return $avatar_defaults; }   add_filter( 'avatar_defaults', 'fb_addgravatar' ); }

In the above code, change ‘Exciting new gravatar’ and point it to the filename of your new Gravatar and you’re done! 9. Changing Your WordPress Feed Links Without .htaccess For our last function we will have a look at a snippet written by WordPress Guru, Justin Tadlock. Though there are many plugins that can do this for us, it is quite easy to pull off. For the snippet we will assume you would like the links to point to a feedburner account.

function custom_feed_link($output, $feed) {   $feed_url = 'http://feeds.feedburner.com/justintadlock';   $feed_array = array('rss' => $feed_url, 'rss2' => $feed_url, 'atom' => $feed_url, 'rdf' => $feed_url, 'comments_rss2' => ''); $feed_array[$feed] = $feed_url; $output = $feed_array[$feed];   return $output; }   function other_feed_links($link) {   $link = 'http://feeds.feedburner.com/justintadlock'; return $link;   } //Add our functions to the specific filters add_filter('feed_link','custom_feed_link', 1, 2); add_filter('category_feed_link', 'other_feed_links'); add_filter('author_feed_link', 'other_feed_links'); add_filter('tag_feed_link','other_feed_links'); add_filter('search_feed_link','other_feed_links');

Change the $feed_url variable to your current feed and go grab some lunch!

Have any custom functions or code snippets you like to use? Share them with us in the comments section below, and don’t forget to check out our WordPress for Designers series we are currently running. Happy coding!

Please subscribe to the Theme Forest RSS Feed, and follow us on Twitter.

]]>
Wed, 29 Apr 2009 09:18:00 -0600 http://www.ooopx.net/items/view/2895/9-useful-snippets-for-your-wordpress-functions
WordPress Plugin: Envato Recent Items, Updated! http://www.ooopx.net/items/view/2876/wordpress-plugin-envato-recent-items-updated

Howdy folks! In case you missed it, I recently wrote an article for the ThemeForest Blog entitled display your recent items with WordPress and the Envato API. This post showed you how to display items from markets like ThemeForest and Flashden on your blog, along with their thumbnails and links. Well, the plugin has been updated with some new features and is now available on the WordPress plugin directory. Read on to find out about the features and how to use the plugin!

Features of the Envato Recent Items Plugin In short, the plugin allows you to easily show and style your recent items from Envato, from any market place (FlashDen, ThemeForest, AudioJungle, GraphicRiver etc). The plugin comes with the following features as of version 1.0:

Thumbnails of item are shown and also link to your item. Any number of items can be shown, depending on your preference. You can choose to display the price of each item if you wish, the price does not display by default. The title, thumbnail, and link are all wrapped in custom classes so you can easily style however you desire. You can now add a referrer ID (username) in case you want to take part of the referral program.

How to use and install

Upload envato_recent_items folder to the /wp-content/plugins/ directory. Activate the plugin through the 'Plugins' menu in WordPress. Place <?php echo envato_recent_items('collis', 'themeforest', 5, true, $ref='collis'); ?> in your template file(s) where you wish the items to be displayed.

The first argument is your username and is required. The second argument is the marketplace and is required. The third argument is the number of items to display and is required. The fourth argument is wether or not to show the price and is not required. Defaults to false. The fifth argument is your referral id (your username) and is not required. Defaults to null.

Now, you may be wondering, why not just have the referral id be the same as the username? Good question. I wanted to keep this plugin as flexible as possible, and there may be cases when the items you are displaying (maybe a buddy or a co workers) would not be the same as your username. Screenshots Below is a screenshot of the plugin without any styling, also note that the price here is being shown, which is off by default:

Below is an excellent use of the plugin by The Molitor:

Download the Plugin! You can download the plugin from the WordPress plugin index. If you have any questions, please be sure to read the FAQ and installation instr unctions on the plugin homepage. Any suggestions or comments are always welcome, enjoy! Donate If you have found this plugin to be helpful, I ask you to consider making a donation of any amount. Donations keep me motivated and allow me to continue to build and enhance WordPress plugins. Any donations are greatly appreciated!

]]>
Sun, 26 Apr 2009 16:37:00 -0600 http://www.ooopx.net/items/view/2876/wordpress-plugin-envato-recent-items-updated
200 Free Web2.0 Wordpress Themes http://www.ooopx.net/items/view/2743/200-free-web20-wordpress-themes

More than 200 High quality Web2.0 Design Wordpress themes, all Categories Included, 2 and 3 Columns, Widgets-ready Themes, Plugins Compatibles, Nice Look, Sexy themes and Much more other Free Wordpress themes. DIRECT LINK »

]]>
Mon, 06 Apr 2009 20:11:00 -0600 http://www.ooopx.net/items/view/2743/200-free-web20-wordpress-themes
40 Excellent Free WordPress Themes http://www.ooopx.net/items/view/2725/40-excellent-free-wordpress-themes

WordPress - the popular open source publishing platform - allows you to easily customize your installation with WordPress themes. Installing themes is a simple affair, and if you’re just starting out with the publishing application, you can check out this guide on using WordPress themes. In this collection, you’ll find 40 high-quality and free WordPress themes handpicked from the vast amount of free themes out there on the web. Note: Be sure to check out the license of the theme for restrictions in usage (if any) and it’s always good (and very much appreciated) to attribute the designer even if they don’t explicitly ask you to. For another great WordPress themes collection, check out: 50 Beautiful Free WordPress Themes. Irresistible

Demo - Download Magazeen

Demo - Download Imprezz

Demo - Download Blues

Download iLibrio

Download Dark Classic

Download remedy

Demo - Download Vintage

Download CorporateMag

Demo - Download Futura

Demo - Download The Morning After

Demo - Download Holiday WordPress

Download Fontanella

Demo (chose Fontanella in the list) - Download Greenway 3C

Demo - Download Grid Focus

Demo - Download Annexation

Demo - Download Brilliance

Demo - Download Love Earth

Demo - Download Compositio

Demo - Download Elegance

Demo - Download Rewire theme

Download Colourise

Demo - Download Individual

Demo - Download WP-Premium

Demo - Download WP ThemedVista

Demo - Download Wynton Magazine

Demo Vectorize

Download Elegant Grunge

Demo - Download Smashing Theme

Download Zeke

Demo - Download Androida

Demo - Download BlakMagik

Demo - Download Love Bugs

Demo - Download (for personal use only) Nature Gift

Download BlackRed

Download Club Yellow

Download Blogtheme

Demo - Download Portfolio - WPESP

Demo - Download iNove

Demo - Download SohoMag

Demo - Download Related content

15 Useful Tools for WordPress Bloggers 30 Excellent WordPress Video Tutorials 45 Beautiful and Creative (WordPress) Designs

About the Author Mirko Humbert is a freelance designer from Switzerland. He shares his thoughts about his passion on his graphic design blog, Designer Daily, and also runs a CSS gallery called CSS Orgy. To connect with Mirko, you can follow him on Twitter.

]]>
Sat, 04 Apr 2009 10:40:00 -0600 http://www.ooopx.net/items/view/2725/40-excellent-free-wordpress-themes
How to modify a WordPress Theme and to make it unique http://www.ooopx.net/items/view/2613/how-to-modify-a-wordpress-theme-and-to-make-it-unique

In this article I will show you how to recreate an existing WordPress Theme and making in it a unique and powerful design just in easy steps. DIRECT LINK »

]]>
Tue, 24 Mar 2009 17:14:00 -0600 http://www.ooopx.net/items/view/2613/how-to-modify-a-wordpress-theme-and-to-make-it-unique
How to Make Unique Front Page Teasers for Wordpress Posts http://www.ooopx.net/items/view/2605/how-to-make-unique-front-page-teasers-for-wordpress-posts

Want some distinction between your blog’s front and post pages? Wish your post displayed differently when viewed in a list? With Wordpress, it’s easier than you think. DIRECT LINK »

]]>
Tue, 24 Mar 2009 06:29:00 -0600 http://www.ooopx.net/items/view/2605/how-to-make-unique-front-page-teasers-for-wordpress-posts
10 Great Free Wordpress Themes http://www.ooopx.net/items/view/2586/10-great-free-wordpress-themes

I did a showcase of 10 Great Wordpress Themes that are very well designed and have a unique look. DIRECT LINK »

]]>
Mon, 23 Mar 2009 06:14:00 -0600 http://www.ooopx.net/items/view/2586/10-great-free-wordpress-themes
Redesigning my blog and lifestream http://www.ooopx.net/items/view/2571/redesigning-my-blog-and-lifestream

nerdsane

in the process of redesigning my lifestream and blog into this,

]]>
Sun, 22 Mar 2009 13:33:00 -0600 http://www.ooopx.net/items/view/2571/redesigning-my-blog-and-lifestream
Redesigning my blog and lifestream http://www.ooopx.net/items/view/2926/redesigning-my-blog-and-lifestream

nerdsane

in the process of redesigning my lifestream and blog into this,

]]>
Sun, 22 Mar 2009 12:33:00 -0600 http://www.ooopx.net/items/view/2926/redesigning-my-blog-and-lifestream
Display your Feedburner stats http://www.ooopx.net/items/view/2558/display-your-feedburner-stats

I’ve been away for the last week. My wife and I bought a flat in North London and finally moved in on March 16th. So I’m currently without the internet and won’t have it until the end of March which is frustrating when I want to update my blog but simply can’t so please excuse my infrequent posts over the next few weeks. Here’s a quick piece of code to simply display your feedburner stats on your blog. I’m yet to post my stats publicly on my blog but have seen numerous blogs with the standard feedburner badge which I think is quite ugly. So here’s how to just get the stats using PHP and CURL. You can then style it how you like.

$ch = curl_init(); //set the feed url and options plus a timeout value $timeout=5; curl_setopt($ch,CURLOPT_URL,'https://feedburner.google.com/api/awareness/1.0/GetFeedData?uri=AshleyFord-Papermashupcom'); curl_setopt($ch,CURLOPT_RETURNTRANSFER,1); curl_setopt($ch,CURLOPT_CONNECTTIMEOUT,$timeout); $result = curl_exec($ch); // get just the subscriber number using the regex function $subscribers = get_match('/circulation="(.*)"/isU',$result);

echo 'Papermashup.com has <strong>'.$subscribers.'</strong> subscribers';

//close connection curl_close($ch);

function get_match($regex,$result) { preg_match($regex,$result,$matches); return $matches[1]; }

]]>
Fri, 20 Mar 2009 09:13:00 -0600 http://www.ooopx.net/items/view/2558/display-your-feedburner-stats
Add Gravatars to your wordpress theme http://www.ooopx.net/items/view/2425/add-gravatars-to-your-wordpress-theme

A few days ago I was looking around the internet for a solution on how to add Gravatar avatars to my Wordpress comments section, and I found out that its easier than I originally thought! I thought there might be quite a bit of code to implement but found out that it requires just one line of PHP. So here are the steps to adding user Gravatars to your comments. Step One The first thing to do i log into your blog and under ‘Settings’ click ‘Discussion’ scroll down to ‘Avatars’ and make sure that you have avatars turned on as shown below.

Once the you have chosen your setup as above you are ready to add the code into your comments template. Step Two Now under ‘Appearance’ select ‘Editor.’ In the right hand column you should see all the files that refer to your current theme. Select ‘Comments comments.php’ the template code for the comments section of your blog will now load in the main window where you can make changes and edit the code. Dependent upon how your theme is structured you should be able to roughly work out where the comments are pulled in as in the image below. I have highlighted where i have added the line of code to pull in users avatars, each comment is placed in a list item. The Gravatar code is then added straight after the opening list item tag. Add this single line of code.

<?php if(function_exists('get_avatar')) { echo get_avatar($comment, '40'); } ?>

And that’s it! Want to see a demo? then leave a comment below and you’ll see the avatars. You will need to style the position of the avatars, size etc which is controlled by the class .avatar

]]>
Mon, 09 Mar 2009 02:02:00 -0600 http://www.ooopx.net/items/view/2425/add-gravatars-to-your-wordpress-theme
WordPress for Designers: 5 http://www.ooopx.net/items/view/2193/wordpress-for-designers-5

Today, we'll be fleshing out our sidebar with some of WordPress' custom functions.

]]>
Fri, 13 Feb 2009 10:11:00 -0700 http://www.ooopx.net/items/view/2193/wordpress-for-designers-5
Diving into Django http://www.ooopx.net/items/view/2142/diving-into-django

It’s always nice to branch out from our usual topics. For today’s screencast entry, Jeff Hui will show us how to build a basic ticket management system, similar to Lighthouse. Though the project won’t be nearly as advanced as Lighthouse - for obvious reasons - it should make for a nice starter for newcomers to the Django framework.

Read On…

If you’re intrigued and would like to learn more, be sure to read our recent “Intro to Django” tut.

Subscribe to the NETTUTS RSS Feed for more daily web development tuts and articles.

]]>
Wed, 11 Feb 2009 00:01:00 -0700 http://www.ooopx.net/items/view/2142/diving-into-django
Download 7 Top Wordpress Themes http://www.ooopx.net/items/view/2138/download-7-top-wordpress-themes

Not only is 7 my lucky number, but we’ve gone and added 7 of the best Wordpress themes we could find. Please feel free to download them. These themes include full PSD-templates and can be used without any restrictions whatsoever. 1:) Urban Elements

Download 2:) FolioTheme

Download 3:) Design Blog

Download 4:) Blues

5:) Pro Mag

Download 6:) No Good News

Download 7:) Vintage

Download Please respect the terms of use from there respectable owners.

]]>
Tue, 10 Feb 2009 12:24:00 -0700 http://www.ooopx.net/items/view/2138/download-7-top-wordpress-themes
WordPress for Designers: Day 4 http://www.ooopx.net/items/view/2050/wordpress-for-designers-day-4

Day 4 is here, and we’re jumping right back into creating our Wordpress theme from scratch! In this episode, we will have our first look at what is known as the Wordpress loop. We will be using the WordPress loop as well as some handy template tags to start pulling out and displaying content from our database. Lets get started!

Day 4: The WordPress Loop

Be sure to click on the “Full Screen Toggle” to move to full screen.

Want More? If you would like to read more about working with the Wordpress loop I encourage you to check out the wordpress documentation on the loop. Help Us!

We put a great deal of effort into bringing you these videos free of charge. If they have helped, we would greatly appreciate a submission to your favorite social networking site. Even a retweet will help! It allows us to continue providing you with top quality content. Thanks again.

Subscribe to the Theme Forest RSS Feed.

]]>
Thu, 05 Feb 2009 09:26:00 -0700 http://www.ooopx.net/items/view/2050/wordpress-for-designers-day-4
WordPress for Designers: Day 4 http://www.ooopx.net/items/view/2072/wordpress-for-designers-day-4

Day 4 is here and we are jumping right back into creating our Wordpress theme from scratch! In this episode, we will have our first look at what is known as the Wordpress loop. We will be using the wordpress loop as well as some handy template tags to start pulling out and displaying content from our database. Lets get started!

]]>
Thu, 05 Feb 2009 08:31:00 -0700 http://www.ooopx.net/items/view/2072/wordpress-for-designers-day-4
WordPress for Designers: Day 3 http://www.ooopx.net/items/view/2007/wordpress-for-designers-day-3

Moving right along into day three of our Wordpress for Designers series; today we will start creating our own theme from scratch. We will have a close look at how exactly to go about setting up your themes stylesheet and information, as well as creating the index.php page. In addition, we will examine wordpress template tags, what they are, and how to use them properly.

Day 3: Creating a Theme From Scratch

Be sure to click on the “Full Screen Toggle” to move to full screen.

Questions?

Have a question or comment about wordpress or a certain aspect of the video? Be sure to ask them in the comment section below - where the community will be glad to help you out!

Stay Tuned.

In day 4 we will be jumping into the wordpress loop and displaying our own custom content and sidebars. Be sure to subscribe to keep up to date with all of the video series!

Help Us!

We put a great deal of effort into bringing you these videos free of charge. If they have helped, we would greatly appreciate a submission to your favorite social networking site. Even a retweet will help! It allows us to continue providing you with top quality content. Thanks again.

Subscribe to the Theme Forest RSS Feed.

]]>
Tue, 03 Feb 2009 21:49:00 -0700 http://www.ooopx.net/items/view/2007/wordpress-for-designers-day-3
Mastering WordPress Shortcodes http://www.ooopx.net/items/view/1991/mastering-wordpress-shortcodes

Introduced in WordPress 2.5, shortcodes are powerful but still yet quite unknown WordPress functions. Imagine you could just type “adsense” to display an AdSense ad or “post_count” to instantly find out the number of posts on your blog. WordPress shortcodes can do this and more and will definitely make your blogging life easier. In this article, we’ll show you how to create and use shortcodes, as well as provide killer ready-to-use WordPress shortcodes that will enhance your blogging experience. What Are Shortcodes?

Using shortcodes is very easy. To use one, create a new post (or edit an existing one), switch the editor to HTML mode and type a shortcode in brackets, such as: [showcase] It is also possible to use attributes with shortcodes. A shortcode with attributes would look something like this: [showcase id="5"] Shortcodes can also embed content, as shown here: [url href="http://www.smashingmagazine.com"]Smashing Magazine[/url] Shortcodes are handled by a set of functions introduced in WordPress 2.5 called the Shortcode API. When a post is saved, its content is parsed, and the shortcode API automatically transforms the shortcodes to perform the function they’re intended to perform. Creating a Simple Shortcode The thing to remember with shortcodes is that they’re very easy to create. If you know how to write a basic PHP function, then you already know how to create a WordPress shortcode. For our first one, let’s create the well-known “Hello, World” message.

Open the functions.php file in your theme. If the file doesn’t exists, create it. First, we have to create a function to return the “Hello World” string. Paste this in your functions.php file: function hello() { return 'Hello, World!'; }

Now that we have a function, we have to turn it into a shortcode. Thanks to the add_shortcode() function, this is very easy to do. Paste this line after our hello() function, then save and close the functions.php file: add_shortcode('hw', 'hello'); The first parameter is the shortcode name, and the second is the function to be called. Now that the shortcode is created, we can use it in blog posts and on pages. To use it, simply switch the editor to HTML mode and type the following: [hw] You’re done! Of course, this is a very basic shortcode, but it is a good example of how easy it is to create one.

Creating Advanced Shortcodes As mentioned, shortcodes can be used with attributes, which are very useful, for example, for passing arguments to functions. In this example, we’ll show you how to create a shortcode to display a URL, just as you would with the BBCodes that one uses on forums such as VBulletin and PHPBB.

Open your functions.php file. Paste the following function in it: function myUrl($atts, $content = null) { extract(shortcode_atts(array( "href" => 'http://' ), $atts)); return '<a href="'.$href.'">'.$content.'</a>'; }

Let’s turn the function into a shortcode: add_shortcode("url", "myUrl");

The shortcode is now created. You can use it on your posts and pages: [url href="http://www.wprecipes.com"]WordPress recipes[/url] When you save a post, the shortcode will display a link titled “WordPress recipes” and pointing to http://www.wprecipes.com.

Code explanation. To work properly, our shortcode function must handle two parameters: $atts and $content. $atts is the shortcode attribute(s). In this example, the attribute is called href and contains a link to a URL. $content is the content of the shortcode, embedded between the domain and sub-directory (i.e. between “www.example.com” and “/subdirectory”). As you can see from the code, we’ve given default values to $content and $atts. Now that we know how to create and use shortcodes, let’s look at some killer ready-to-use shortcodes! 1. Create a “Send to Twitter” Shortcode

The problem. Seems that a lot of you enjoyed the “Send to Twitter” hack from my latest article on Smashing Magazine. I also really enjoyed that hack, but it has a drawback: if you paste the code to your single.php file, the “Send to Twitter” link will be visible on every post, which you may not want. It would be better to control this hack and be able to specify when to add it to a post. The solution is simple: a shortcode! The solution. This shortcode is simple to create. Basically, we just get the code from the “Send to Twitter” hack and turn it into a PHP function. Paste the following code in the functions.php file in your theme: function twitt() { return '<div id="twitit"><a href="http://twitter.com/home?status=Currently reading '.get_permalink($post->ID).'" title="Click to send this page to Twitter!" target="_blank">Share on Twitter</a></div>'; }

add_shortcode('twitter', 'twitt'); To use this shortcode, simply switch the editor to HTML mode and then type: [twitter] and a “Send to Twitter” link will appear where you placed the shortcode. Source and related plug-ins:

How to: Create a “send this to twitter” button Twitter tools

  1. Create a “Subscribe to RSS” Shortcode

The problem. You already know that a very good way to gain RSS subscribers is to display a nice-looking box that says something like “Subscribe to the RSS feed.” But once again, we don’t really want to hard-code something into our theme and lose control of the way it appears. In this hack, we’ll create a “Subscribe to RSS” shortcode. Display it in some places and not others, in posts or on pages, above or below the main content, it’s all up to you. The solution. As usual, we create a function and then turn it into a shortcode. This code goes into your functions.php file. Don’t forget to replace the example feed URL with your own! function subscribeRss() { return '<div class="rss-box"><a href="http://feeds.feedburner.com/wprecipes">Enjoyed this post? Subscribe to my RSS feeds!</a></div>'; }

add_shortcode('subscribe', 'subscribeRss'); Styling the box. You probably noticed the rss-box class that was added to the div element containing the link. This allows you to style the box the way you like. Here’s an example of some CSS styles you can apply to your “Subscribe to RSS” box. Simply paste it into the style.css file in your theme: .rss-box{ background:#F2F8F2; border:2px #D5E9D5 solid; font-weight:bold; padding:10px; } 3. Insert Google AdSense Anywhere

The problem. Most bloggers use Google AdSense. It is very easy to include AdSense code in a theme file such as sidebar.php. But successful online marketers know that people click more on ads that are embedded in the content itself. The solution. To embed AdSense anywhere in your posts or pages, create a shortcode:

Open the functions.php file in your theme and paste the following code. Don’t forget to modify the JavaScript code with your own AdSense code! function showads() { return '<div id="adsense"><script type="text/javascript"><!-- google_ad_client = "pub-XXXXXXXXXXXXXX"; google_ad_slot = "4668915978"; google_ad_width = 468; google_ad_height = 60; //--> </script>

<script type="text/javascript" src="http://88.198.60.17/images/mastering-wordpress-shortcodes/http://pagead2.googlesyndication.com/pagead/show_ads.js"> </script></div>'; }

add_shortcode('adsense', 'showads');

Once you have saved functions.php, you can use the following shortcode to display AdSense anywhere on your posts and pages: [adsense] Note that our AdSense code is wrapped with an adsense div element, we can style it the way we want in our style.css file.

Code explanation. The above code is used simply to display AdSense ads. When the shortcode is inserted in a post, it returns an AdSense ad. It is pretty easy but also, you’ll agree, a real time-saver! Sources:

How to: Embed AdSense anywhere on your posts

  1. Embed an RSS Reader

The problem. Many readers also seemed to enjoy the “8 RSS Hacks for WordPress” post published on Smashing Magazine recently. Now, let’s use our knowledge of both RSS and shortcodes to embed an RSS reader right in our posts and pages. The solution. As usual, to apply this hack, simply paste the following code in your theme’s function.php file. //This file is needed to be able to use the wp_rss() function. include_once(ABSPATH.WPINC.'/rss.php');

function readRss($atts) { extract(shortcode_atts(array( "feed" => 'http://', "num" => '1', ), $atts));

return wp_rss($feed, $num);

}

add_shortcode('rss', 'readRss'); To use the shortcode, type in: [rss feed="http://feeds.feedburner.com/wprecipes" num="5"] The feed attribute is the feed URL to embed, and num is the number of items to display. 5. Get posts from WordPress Database with a Shortcode The problem. Ever wished you could call a list of related posts directly in the WordPress editor? Sure, the “Related posts” plug-in can retrieve related posts for you, but with a shortcode you can easily get a list of any number of posts from a particular category. The solution. As usual, paste this code in your functions.php file. function sc_liste($atts, $content = null) { extract(shortcode_atts(array( "num" => '5', "cat" => '' ), $atts)); global $post; $myposts = get_posts('numberposts='.$num.'&order=DESC&orderby=post_date&category='.$cat); $retour='<ul>'; 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("list", "sc_liste"); To use it, simply paste the following in the WordPress editor, after switching to HTML mode: [liste num="3" cat="1"] This will display a list of three posts from the category with an ID of 1. If you don’t know how to get the ID of a specific category, an easy way is explained here. Code explanation. After it has extracted the arguments and created the global variable $posts, the sc_liste() function uses the get_posts() function with the numberposts, order, orderby and category parameters to get the X most recent posts from category Y. Once done, posts are embedded in an unordered HTML list and returned to you. Source:

WordPress: Création de shortcode avancé

  1. Get the Last Image Attached to a Post The problem. In WordPress, images are quite easy to manipulate. But why not make it even easier? Let’s look at a more complex shortcode, one that automatically gets the latest image attached to a post. The solution. Open the functions.php file and paste the following code: function sc_postimage($atts, $content = null) { extract(shortcode_atts(array( "size" => 'thumbnail', "float" => 'none' ), $atts)); $images =& get_children( 'post_type=attachment&post_mime_type=image&post_parent=' . get_the_id() ); foreach( $images as $imageID => $imagePost ) $fullimage = wp_get_attachment_image($imageID, $size, false); $imagedata = wp_get_attachment_image_src($imageID, $size, false); $width = ($imagedata[1]+2); $height = ($imagedata[2]+2); return '<div class="postimage" style="width: '.$width.'px; height: '.$height.'px; float: '.$float.';">'.$fullimage.'</div>'; } add_shortcode("postimage", "sc_postimage"); To use the shortcode, simply type the following in the editor, when in HTML mode: [postimage size="" float="left"] Code explanation. The sc_postimage() function first extracts the shortcode attributes. Then, it retrieves the image by using the get_children(), wp_get_attachment_image() and wp_get_attachment_image_src() WordPress functions. Once done, the image is returned and inserted in the post content. Sources:

WordPress Shortcode: easily display the last image attached to post

  1. Adding Shortcodes to Sidebar Widgets

The problem. Even if you enjoyed this article, you may have felt a bit frustrated because, by default, WordPress doesn’t allow shortcode to be inserted into sidebar widgets. Thankfully, here’s a little trick to enhance WordPress functionality and allow shortcodes to be used in sidebar widgets. The solution. One more piece of code to paste in your functions.php file: add_filter('widget_text', 'do_shortcode'); That’s all you need to allow shortcodes in sidebar widgets! Code explanation. What we did here is quite simple: we added a filter on the widget_text() function to execute the do_shortcode() function, which uses the API to execute the shortcode. Thus, shortcodes are now enabled in sidebar widgets. Sources:

How to: Add Shortcodes to Sidebar Widgets Adding a Shortcode to a Sidebar Widget

WordPress Shortcodes Resources

Shortcode API The WordPress Codex page related to the shortcode API. WordPress 2.5 shortcodes Excellent shortcodes tutorial. WordPress shortcode generator The page is in French but provides a very useful and easy-to-use app to create shortcodes online. Using Wordpress shortcode to create beautiful download boxes Another great use of shortcodes: creating fancy “Download” boxes for your blog. Easy way to advertise in WordPress using shortcodes Great resource to manage and insert advertising on your blog, brought to you by WpEngineer. Create a signature using WordPress shortcodes Really simple but really cool: a shortcode to display a graphic signature on your blog. How to: Use WordPress shortcodes with attributes Concise tutorial on using shortcode attributes.

About the author This guest post was written by Jean-Baptiste Jung, a 27-year-old blogger from Belgium, who blogs about WordPress at WpRecipes and about everything related to blogging and programming at Cats Who Code. You can stay in touch with Jean by following him on Twitter. (al)

]]>
Mon, 02 Feb 2009 21:00:00 -0700 http://www.ooopx.net/items/view/1991/mastering-wordpress-shortcodes
30 Desktop and Office Themed Website Designs http://www.ooopx.net/items/view/1996/30-desktop-and-office-themed-website-designs

Its seems like the desktop and office style websites have been a popular design idea for a few years now. While many of these design share some of the same elements, it is always interested to see the random extras and nic-nacs that people add to them. What is even more interesting about this style is how it has crossed over to many other genres of business aside from designers. You will notice that we included a few websites from other industries that follow the same basic idea of the desktop design. Blueprint Ads

Narf Stuff

Totally Her

ABI Blog

1080 Snowboard Company

Doodle Freenzy

UAE Abandoned

Chris Likes to Draw

Aleksander Antonov

Restaurant Nuevo Aurich - Ok, so it’s not an office per say, but it still looks tasty and follows the same idea. I could make this my office!

Dan Whittiker Creative

Mitexel

Respiro Media

Rx Monsters - Not everyone’s desk looks the same!

Simple Art

iSpoil

Jake Boyles

John Joubert

Opelika Daily News

The Piss Biscuit

Camila Colaneri

DPI Vision

New Zealand Travel Blog

Avrind Andrion

Ciao Cimba - Such a crafty little desk.

Visit Delaware

The Cook Blog

No Copy Cat

Revota

Keanetix

What do you think it is that makes this sort of design so popular? Share your thoughts with us in the comments below.

]]>
Mon, 02 Feb 2009 12:37:00 -0700 http://www.ooopx.net/items/view/1996/30-desktop-and-office-themed-website-designs