<?php 
function qaleb_folder_template($filepath, $filename){
	require_once(get_template_directory() . '/' . $filepath . '/' . $filename . '.php');		
}
add_action( 'register_qaleb_folder_template', 'qaleb_folder_template' );

function qaleb_template($filename){
	$themefilename = get_template_directory() . '/' . $filename ;
	if(file_exists($themefilename)){
		require_once($themefilename);
	}
}
add_action( 'register_qaleb_template', 'qaleb_template' );

function get_qaleb_template_url(){
	get_template_directory_uri();
}
add_action( 'register_get_qaleb_template_url', 'get_qaleb_template_url' );

function qaleb_template_url(){
	echo get_template_directory_uri();
}
add_action( 'register_qaleb_template_url', 'qaleb_template_url' );

function qaleb_loop($args_name,$post_type,$posts_to_show,$content){
$args_name = new WP_Query(array(
	'post_type' => $post_type,
	'posts_per_page'=> $posts_to_show,
));
if($args_name->have_posts()) : while($args_name->have_posts()) : $args_name->the_post();
echo $content;
endwhile; endif; wp_reset_query();

}
add_action( 'register_qaleb_loop', 'qaleb_loop' );