Skip to main content
corrected code formatting
Source Link
s_ha_dum
  • 65.5k
  • 13
  • 84
  • 174

This is my code, why cant i get post per page and offset result ?.


 
 <?php 
    $myquery['tax_query'] = array(
        'relation' =>=> 'OR',
        'posts_per_page' =>=> 3,
        'offset' =>=> 3,
    array(
        'taxonomy' =>=> 'brands',
        'terms' =>=> array('iHOME'),
        'field' =>=> 'slug',
        ));
    query_posts($myquery);?>>
<?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>>
<?php the_post_thumbnail();?>>
<?php the_title();?><b><?php the_title();?></b>

<?php echo excerpt(25); ?>

<p><?php echo excerpt(25); ?></p> <?php echo esc_html( get_post_meta( get_the_ID(), 'category', true ) ); ?>> <?php endwhile; else: ?>> <?php endif; ?>>
 

This is my code, why cant i get post per page and offset result ?.


 
 <?php 
    $myquery['tax_query'] = array(
        'relation' => 'OR',
        'posts_per_page' => 3,
        'offset' => 3,
    array(
        'taxonomy' => 'brands',
        'terms' => array('iHOME'),
        'field' => 'slug',
        ));
    query_posts($myquery);?>
<?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>
<?php the_post_thumbnail();?>
<?php the_title();?>

<?php echo excerpt(25); ?>

<?php echo esc_html( get_post_meta( get_the_ID(), 'category', true ) ); ?> <?php endwhile; else: ?> <?php endif; ?>
 

This is my code, why cant i get post per page and offset result ?.

<?php 
    $myquery['tax_query'] = array(
        'relation' => 'OR',
        'posts_per_page' => 3,
        'offset' => 3,
    array(
        'taxonomy' => 'brands',
        'terms' => array('iHOME'),
        'field' => 'slug',
        ));
    query_posts($myquery);?>
<?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>
<?php the_post_thumbnail();?>
<b><?php the_title();?></b>
<p><?php echo excerpt(25); ?></p>
<?php echo esc_html( get_post_meta( get_the_ID(), 'category', true ) ); ?>

<?php endwhile; else: ?>
<?php endif; ?>
added 24 characters in body
Source Link

This is my code, why cant i get post per page and offset result ?.


><?php 
    $myquery['tax_query'] = array(
        'relation' => 'OR',
        'posts_per_page' => 3,
        'offset' => 3,
    array(
        'taxonomy' => 'brands',
        'terms' => array('iHOME'),
        'field' => 'slug',
        ));
    query_posts($myquery);?>
><?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>
><?php the_post_thumbnail();?>
><?php the_title();?>

><?php echo excerpt(25); ?>

><?php echo esc_html( get_post_meta( get_the_ID(), 'category', true ) ); ?> ><?php endwhile; else: ?> ><?php endif; ?>

This is my code, why cant i get post per page and offset result ?.


>?php 
    $myquery['tax_query'] = array(
        'relation' => 'OR',
        'posts_per_page' => 3,
        'offset' => 3,
    array(
        'taxonomy' => 'brands',
        'terms' => array('iHOME'),
        'field' => 'slug',
        ));
    query_posts($myquery);?>
>?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>
>?php the_post_thumbnail();?>
>?php the_title();?>

>?php echo excerpt(25); ?>

>?php echo esc_html( get_post_meta( get_the_ID(), 'category', true ) ); ?> >?php endwhile; else: ?> >?php endif; ?>

This is my code, why cant i get post per page and offset result ?.


<?php 
    $myquery['tax_query'] = array(
        'relation' => 'OR',
        'posts_per_page' => 3,
        'offset' => 3,
    array(
        'taxonomy' => 'brands',
        'terms' => array('iHOME'),
        'field' => 'slug',
        ));
    query_posts($myquery);?>
<?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>
<?php the_post_thumbnail();?>
<?php the_title();?>

<?php echo excerpt(25); ?>

<?php echo esc_html( get_post_meta( get_the_ID(), 'category', true ) ); ?> <?php endwhile; else: ?> <?php endif; ?>
Source Link

post-per-page and offset not working

This is my code, why cant i get post per page and offset result ?.


>?php 
    $myquery['tax_query'] = array(
        'relation' => 'OR',
        'posts_per_page' => 3,
        'offset' => 3,
    array(
        'taxonomy' => 'brands',
        'terms' => array('iHOME'),
        'field' => 'slug',
        ));
    query_posts($myquery);?>
>?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>
>?php the_post_thumbnail();?>
>?php the_title();?>

>?php echo excerpt(25); ?>

>?php echo esc_html( get_post_meta( get_the_ID(), 'category', true ) ); ?> >?php endwhile; else: ?> >?php endif; ?>