Thanks to Chip Bennett who told me that i’m doing wrong by using query_posts
inside content. So i used get_posts
and i got what i wanted, thanks!
Here is sample of how can you do it, if you got the same problem as me:
function some_name(){
global $post;
$tmp_post = $post;
$args = array( 'post_type'=>'page', 'numberposts' => -1, 'orderby'=> 'title', 'order' => 'ASC' );
$myposts = get_posts( $args );
if ( !empty($myposts) ) {
foreach( $myposts as $post ) : setup_postdata($post);
the_title();
echo '<br>';
endforeach;
}
$post = $tmp_post;
}