Filtering Posts by Categories or Exclude Uncategorized Posts

In this post, You’ll learn how to filter posts by categories. In this case we get all categories first and then get all post belongs to these categories. That sounds like we get all posts but it’s not.

Actually Uncategorized shown as category on WordPress back-end. But it means post not linked with any category.

You can’t directly query Uncategorized post. But we can simply filter all post has category and we can also get reverse of these posts.

Ta-da! We have filter uncategorized posts!


$allCategories = array();
$categories=get_categories();
foreach($categories as $category) {
$allCategories[] = $category->slug;
}

$args = array(
'post_type' => 'post',
'post_status' => 'publish',
'tax_query' => array(
'relation' => 'AND',
array(
'taxonomy' => 'category',
'field' => 'slug',
'terms' => $allCategories,
'operator' => 'IN'
)
)

);
$posts = get_posts( $args );

Some more play
You may play with the code a little. If you change operator as NOT IN, this time you can get only uncategorized posts.

Posted in Coding | Tagged , , , , | Leave a comment

Internet Tutulmasi (Anti-SOPA) Plugin

There is a little plugin that we published for Anti-SOPA campaign.

You can download it from here:  wp-itutulmasi

Posted in Our Wordpress Plug-ins | Leave a comment

Working with Huge Taxonomies

Working with huge dataset always brings some technical diffuculties. Hierarchical taxonomies or as a common word “Category” saves lots of time to the developers but it can easily to be a headache if some features of taxonomies doesn’t works as expected.

There is caching feature exists in the taxonomies. That’s also saves server by caching hierarchy which needs high processor use.

Sometimes, especially if you working with larger taxonomies, caching feature may not work correctly. Normally there is WordPress function which just runs after any update taxonomy. The function name is clean_term_cache().

You can use that one if you add taxonomy by WordPress API. That function will recreate cache and it will solve disappear problem of any recently added taxonomy.

Typical use of the function is just like that:

clean_term_cache(”,’location’);

location is our custom taxonomy name, you can use category for Categories also.

Posted in Wordpress | Tagged , , , , | Leave a comment

Comparation of Private Messaging Plugins

If you are developing a network with WordPress, private messaging feature in the network will be essential. Interaction between users and also site editors will bring user loyalty which is very important for networks.

There is a couple of private messaging plugins exists for WordPress. But which one is more suitable for your project. In our case, we’ll use it in a huge network, so we have many demand from plugin.

Before start analyzing existing solutions, let define features from different viewpoints.

Security Viewpoint:

  • Does it works from backend or frontend?: Opening frontend to user may bring some security problems. May some other plugins designed with less secure because of they are using in limited people.
  • Can any user access all of the user data?: When we are checking candidates, we discovered that some of plugins show all user data in a simple combobox or they can easily fetch-able by anyone using features like autocomplete.
  • Is there any time based Message filter?: To prevent flood or abusing system, message system needs time limit for messages.

User Experience Viewpoint:

  • Does it support any threaded messages?: Threading messaging is very  useful especially for long threads.
  • Does it have any send mail when new pm posts option?: The system able to alert users when they get messages.
  • Does it have offensive language filter?: A global or user based offensive language filtering system is a must such as these features.
  • Can user block any user or disable all system?: It is another important feature because some users can disturb other users so it causes to lose your visitors.
Developer Viewpoint:
  • Does it support any kind of ready to use functions in loop?: Users may want to interact with peoples such as post author or commentors for private concerns. Dozens of sites uses public comment feature instead of this one because of lack of feature.
  • Does it came with any widget?: Widgets like read inbox would useful for website developers.
  • Does it have it’s own capability scheme?: So you decide which users can use message or not.
  • Does it support filter and action hooks for extending further purposes?: That’s a need for extending messaging features for extras.

CubePM

It’s one of the good choice for if you are not expecting much while searching ready to use PM solution.

Cartpauj PM

It’s very similar to Cube PM, it has global announcement system. So you can post messages to all of your users. Another additional feature is users can disabled system.

WP Private Messages

WP Private Messages seems as the weakest link in the group. It looks like really private message system rather than messaging system between users.

Private Messages for WordPress

This plugin is only plugin that comes with widget. It’s also only plugin works over backend and frontend at the same time.

Feature NameCubePMCartpauj PMWP Private MessagesPrivate Messages for WordPress
Total Number of Passed Feature5 / 115 / 112/115/11
Security Viewpoint:
Does it works from backend or frontend?Frontend (shortcode for Pages)Frontend (shortcode for Pages)BackendBoth
Can any user access all of the user data?Yes, via autocompleteYes, via autocompleteYesYes
Is there any time based Message filter?NoNoNoNo
User Experience Viewpoint
Does it support any threaded messages?YesYesYesYes
Does it have any send mail when new pm posts option?YesYesNoYes
Does it have offensive language filter?NoNoNoNo
Can user block any user or disable all system?NoYesNoNo
Developer Viewpoint
Does it support any kind of ready to use functions in loop?NoNoNoNo
Does it came with any widget?NoNoNoYes
Does it have it’s own capability scheme?Yes, PartiallyNoNoNo
Does it support filter and action hooks for extending further purposes?NoNoNoNo

Conclusion

Our inspection over all of these plugins shows none of them are perfect messaging system.

Posted in Plug-ins | Leave a comment

6 Essential WordPress Plug-in

WordPress has many plug-ins and website owners can easily lost them in the tons of plug-ins. Many of plug-ins will cause to slow your website. So then, which plug-ins we must use at least?

All in One SEO Pack

Search Engine Optimization is very important thing nowadays. You can change all titles, metas and descriptions as you want.

Socialize

Socialize is very useful to insert social media sharing items into the posts. It has a call to action box that calls users comment and share.

It supports all of the most popular sharing tools with different size and style options like Facebook, Twitter, Linked In, Google+ and more.

Google XML Sitemaps

May a typical WordPress site is very understandable for most of your visitors. But search engine bots may confuse on the site, and they might lost their way. The solution was came from search engines: Sitemaps. Google and Yahoo are both supports sitemaps today. The Google XML Sitemaps plug-in generates sitemaps so search engines can index your site completely.

W3 Total Cache
Google Analyticator

If you want to success with your website you need to track users demands. For that, you need to track your website. So Google Analytics service is the best and favorite of everyone.

Google Analyticator have some great features. Firstly you can easily connect your Google Account with plug-in. You don’t even have to know your sites Analytics UID. After you connect site, it retrieves all your existing account from your Google Account via Analytics API. Then you can select your website from dropdown list. That’s all!

It came with very useful, Google Analytics Dashboard Widget. So you can follow summary from your dashboard. Also there is an widget for front-end.

Social Connect

There are numerous social network connector exists but this one is one of the simplest and cleanest plug-in rather than others. It’s also describes well where is the Facebook and Twitter applications exists, and explains what you must do step by step basis.

The best part of plug-in is you can easily call connect codes in where ever you want.

While Facebook and Twitter Connect functionality working well, there is some problem with Open ID and WordPress.com integration. It’s very new plug-in and there is lot to do on it but it became one of my favorite with it simplicity.

Posted in Plug-ins | Tagged , , , , , , , , , | Leave a comment