wpMail.me – a concise, once weekly free roundup of WordPress news and articles


wpMail.me is a concise, once-weekly free round up of news and articles. It’s main goal is to ease some of the information overload we encounter in our daily computing by providing with a list of curated articles, news and tutorials. Also since it’s once a week you can batch process it all in 1 hour a week, leaving you with extra free time.

Read More »

By Posted in Wordpress | Tagged , , | 1 Comment

Get the latest comments for a custom post type in WordPress

Custom post types for WordPress support comments, however the API doesn’t allow for retrieving those comments.

So in order to get the latest comments from your custom post type you need to do an sql query that does a LEFT OUTER JOIN between the comments table and the posts table:

 
/* Get recent comments */
global $wpdb;
 
$sql = "SELECT * 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 = '' AND post_type='your_custom_post_type' ORDER BY comment_date_gmt DESC LIMIT 5";
 
$comments = $wpdb->get_results($sql);
 
foreach ($comments as $comment) {
  // we need the comment comment user_id in case it's a logged in user so we can echo the display name and not username
  if ($comment->user_id != 0) {
    $curent_userdata = get_userdata($comment->user_id);
    echo $curent_userdata->display_name;
  } else {
    echo strip_tags($comment->comment_author);
  }
 
  // the permalink for the comment
  echo get_permalink($comment->ID) . '#comment-' . $comment->comment_ID;
 
  // the post title where that comment was posted
  echo $comment->post_title; 
 
  // display the comment content
  echo strip_tags($comment->comment_content);
}

Read More »

By Posted in plugins, Wordpress | Tagged , | 2 Comments

SVN EOL and the WordPress.org repository

As you might now we’ve recently released Profile Builder e front-end registration, login and edit profile plugin.

All went well and we’ve got proper feedback. Apparently people liked the idea.

However, when the time came to put it on the repository things started to get weird. For reasons beyond my understanding, the profilebuilder.php and uninstall.php files were converted to Mac EndOfLine style once uploaded to the Repository (I’m a PC user). Because of this the plugin install would fail and didn’t even appear in the plugin listing in the backend, which is to be expected since the lines were all scrambled up.

After a bit of digging around I found about a SVN property called svn:eol-style that, when set to “native“, allows automatic conversion of end-of-lines, depending whether you are on Linux or Windows. Apparently this isn’t setup by default when you install Turtoise SVN.

To get is sorted you need to add some code to the config file in subversion.

Read More »

By Posted in General, plugins, Wordpress | Tagged , , | Leave a comment

Professional WordPress Plugin Development review

It’s been a while since I’ve reviewed books on this blog and I think it’s about time to start doing that again. And I couldn’t have chosen a better book to start with then “Professional WordPress Plugin Development” written by Brad Williams, Ozh Richard and Justin Tadlock.

This is the book I’ve been waiting for ever since I started to work with WordPress 3 years ago. As a theme designer and developer you really have a lot of documentation online. However, the instance you need to do some wild things with WordPress you realize there just isn’t enough information to go on. I’m talking about stuff like plugin security, proper way of handling plugin settings, ajax in WordPress, cron, the rewrite API and developing for multisite.

Read More »

By Posted in Book Review, General, Recomended Reading, Wordpress | Tagged , , , , | 3 Comments

Cozy Child Theme

This elegant WordPress theme started as a custom project but ended up as a Child Theme for the Thematic Framework.

It’s a warm design that makes you feel comfortable.

Cozy Child Theme for Thematic Framework

Read More »

By Posted in Recomended Reading, Thematic, Theme Design | Tagged , , | 1 Comment

Thematic PHP constants

With Thematic 0.9.7.7 there are a couple of changes made to the way it works. One of those changes was the inclusion of a few constants, that based on their value lets you chose whether you want the default WordPress functionality or the more powerful (and complex) Thematic functionality.

I’m talking here about whether you want to make use of the following:

  • Thematic body class
  • Thematic post class
  • Thematic comment form
  • Thematic feedlinks
  • Thematic’s handling of comments

These constants should be setup inside your childtheme’s functions.php file like so:

// Unleash the power of Thematic's dynamic classes
// 
 define('THEMATIC_COMPATIBLE_BODY_CLASS', true);
 define('THEMATIC_COMPATIBLE_POST_CLASS', true);
 
// Unleash the power of Thematic's comment form
//
 define('THEMATIC_COMPATIBLE_COMMENT_FORM', true);
 
// Unleash the power of Thematic's feed link functions
//
 define('THEMATIC_COMPATIBLE_FEEDLINKS', true);
 
// Unleash the power of Thematic's comment handling
//
 define('THEMATIC_COMPATIBLE_COMMENT_HANDLING', true);

Hope someone finds these things useful.

By Posted in Thematic, Wordpress | Leave a comment

All Child Themes got updated

While a bit late, we finally managed to get all Child Themes that are free for download updated to work with the latest Thematic (# Version: 0.9.7.7).

Early Morning, Street and Byty now make use of the WordPress 3.0 menu system, while Commune now makes use of the Featured thumbnail image that comes with WordPress (no more category images that weren’t working anyway) and we updated the menu to work with wp_nav_menu just like the rest of the themes.

We have plans for some new Child Themes in the near future so please stay tuned.

By Posted in Thematic, Wordpress | Tagged , | 2 Comments

QandaPress, a Q&A platform based on WordPress

During the last couple of months we received several requests from our friends and clients, mainly professional bloggers, who were permanently seeking solutions to expand their blog audience.
They wanted a tool to help them grow their reader base and make the content become more socially engaging. One of the things that got to our ears was a Q&A platform, with some built in game mechanics. A way in which the readers could interact by adding another type of content to the blog.

So the need was for a very simple way to create a Q&A website using WordPress. And this is how QandaPress was born.

QandaPress - Build your own Q&A community

QandaPress makes it easy to build a community around your website. Here are some of its features:

  • It is built on WordPress, so learning something new is out of the question. You will manage your Q&A platform in a very familiar environment.
  • Easy to monetize. Multiple ad zones where you can insert your own ads.
  • Problem free. All technical details are taken care of. No need to manage another WordPress installation.
  • Scalable. Everything is run on our own super-optimized servers. You don’t have to worry about downtime due to traffic spikes.

You can find some other cool features on the QandaPress website. Feel free to use the comment section and tell us what you think about it and what other features you would like to be added.

Also the first persons who will apply for the QandaPress private beta by December 1′st, will get an all time 30% discount subscription rate.

By Posted in Recomended Reading, Wordpress | Tagged , , , | 7 Comments

WordPress pieces of code of the month

I found two pieces of code for WordPress that might come in handy from time to time.

Custom Post Types pagination for the homepage

It appears there’s a bug in WP 3.0 with the pagination on the homepage for custom post types.

When we create an archive page for a custom post type we make a page template where we use query_posts() to list them.

However, when we make try to put the pagination in place using get_query_var(‘paged’) it fails.

global $paged;
 
//this code doesn't work
//$paged = (get_query_var('paged')) ? get_query_var('paged') : 1;
 
//this code works
if ( get_query_var('paged') )
	$paged = get_query_var('paged');
elseif ( get_query_var('page') )
	$paged = get_query_var('page');
else
	$paged = 1;
 
$args=array(
	'post_type' => 'cpt',
	'paged' => $paged,
	'posts_per_page' => 10,
	'post_status' => 'publish',
);
query_posts($args);
Thanks go to Devin Price for pointing me in the right direction.

Extend category permalinks to query for tags

While most people don’t need this, from time to time you might want to have query posts that are in category ‘x’ and are tagged with ‘y’. WordPress can query for that very easily, all we need to do is add the permalinks structure: www.example.com/category/x/tag/y/

function extend_category_tag_flush_rewrite_rules() {
	global $wp_rewrite;
	$wp_rewrite->flush_rules();
}
add_action('init', 'extend_category_tag_flush_rewrite_rules');
 
function extend_category_tag_add_rewrite_rules($wp_rewrite) {
	$rules = array();
	$structures = array(
		$wp_rewrite->get_category_permastruct() . $wp_rewrite->get_tag_permastruct(),
	);
	foreach( $structures as $s ){
		$rules += $wp_rewrite->generate_rewrite_rules($s);
	}
	$wp_rewrite->rules = $rules + $wp_rewrite->rules;
}
add_action('generate_rewrite_rules', 'extend_category_tag_add_rewrite_rules');

You can add this code in your function.php file the theme came with.

Code based on: sltaylor.co.uk/blog/
By Posted in Wordpress | Tagged , , | 2 Comments