I try wordpress query from separate php file its work good but i need query offset value from my own, how can i ?
if (!isset($_GET['startrow']) or !is_numeric($_GET['startrow'])) {
$startrow = 0;
} else {
$startrow = (int)$_GET['startrow'];
}
?>
<ul>
<?php
$posts = get_posts('numberposts=10&offset=0');
foreach($posts as $post) {
echo '<li><a href="' . get_permalink($post->ID) . '" title="'. $post->post_title .'" >' . $post->post_title .'</a> </li> ';
} ?>
</ul>
i want replace my $startrow value 'numberposts=10&offset=0' to 'numberposts=10&offset=$startrow'
but this is not work
my url going like this myurl
domain/my.php?startrow =100