WordPress’s is_blog_page() function.

In WordPress some time we need to detect the blog page to add extra functionality. Following WordPress function would be helpful to find out the current page is blog page or not.

/**
 * WordPress' missing is_blog_page() function.  Determines if the currently viewed page is
 * one of the blog pages, including the blog home page, archive, category/tag, author, or single
 * post pages.
 *
 * @return bool
 */
function is_blog_page() {
global $post;

//Post type must be 'post'.
$post_type = get_post_type($post);
//Check all blog-related conditional tags, as well as the current post type,
//to determine if we're viewing a blog page.
return (
( is_home() || is_archive() || is_single() )
&& ($post_type == 'post')
) ? true : false ;
}

code source :https://gist.github.com/wesbos/1189639

Prevent jQuery and MooTools conflicts in Joomla

Jquery and mootools both are popular JavaScript library and Joomla developers often use both. when you want to use both in joomla module or joomla component then remember the point is that mootools library must be loaded before jquery. So far not a big deal, but without forcing mootools to be loaded first there is a chance that your jquery code will be conflict the code.Continue reading “Prevent jQuery and MooTools conflicts in Joomla”