OK, I'm using posts_query() to display posts.
The problem is, at least in my case, posts_query() always outputs something.
For example:
<?php
$paged = (get_query_var('paged')) ? get_query_var('paged') : 1;
query_posts("posts_per_page=1&paged=$paged");
global $more;
$more = 0;
while ( have_posts() ) : the_post(); ?>
<!--- DO NOTHING ! -->
<?php endwhile ?>
Displays raw first part of a post (and without $more = 0 the whole post).
Why is it happening?
I want to style the output on my own, but I'm not able to, because for example:
while ( have_posts() ) : the_post(); ?>
<h1><?php the_title();?></h1>
<h3><?php the_content( __( '') ); ?></h3>
<?php endwhile ?>
Gives:
<h1>MyTitle</h1>
<h3>something something something something something</h3>
<p>something something something something something</p> <!-- (wherethis line comes from? ;/) ?>
PS.
In addition I'm almost sure pagination doesn't work as well, and I believe it should this way? I have around 15 posts to display, I've chosen 1, why there's no navi? :(
The exact code:
function posts_shortcode( $atts ) {
extract( shortcode_atts( array(
), $atts ) );
query_posts("posts_per_page=1");
global $more;
$more = 0;
while ( have_posts() ) : the_post(); ?>
<h1><?php the_title();?></h1>
<h3><?php the_content( __( '') ); ?></h3>
<?php endwhile;
}
add_shortcode('posts', 'posts_shortcode');