最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

pagination - How can I use var php with javascript to build custom page?

programmeradmin0浏览0评论
Closed. This question needs details or clarity. It is not currently accepting answers.

Want to improve this question? Add details and clarify the problem by editing this post.

Closed 4 years ago.

Improve this question

is variable increment in $post_per_page = 10 if click on button next I can increase $Post_per_page = by_call <button type="button" value="increment++" >Increment </button>

In Pos_per_page.php

 $offset = $_GET["offset"]; // gets from primary page  

the SQL call:

"Select blah from blah order by blah limit 50, $offset";


<script>
$(window).scroll(function () {
 if ($(window).scrollTop() >= $(document).height() - 
 $(window).height() - 10) {

$.get('Pos_per_page.php?offset=10', function(data) {
    // only increse
});
   }
});
 <?php $posts_per_page = 10;
   $attachments = get_posts(array(
    'post_type'   => 'attachment',
    'posts_per_page' => $posts_per_page,
    'paged' => $paged,
    /*'numberposts' => 10,*/
   'category_name' => $currentSegment
 ));

 if ($attachments) {
    foreach ($attachments as $image) {
    $attachmenturl_meta = wp_get_attachment_metadata($image->ID);
    $attachmenturl = wp_get_attachment_url($image->ID);
    $attachmentimage = wp_get_attachment_image_src($image->ID, 'full');
    $attachmentvideo = wp_get_attachment_url($image->ID, 'full');
    $imageDescription = apply_filters('the_description', $image->post_content);
    $imageTitle = apply_filters('the_title', $image->post_title);
?>

    <a data-magnify="gallery" href="<?php echo $attachmentimage[0] ?>" data-src="<?php echo $attachmentimage[0] ?>" data-caption="<?php echo  $attachmentimage[0]; ?>" class="image-grid__item lightbox">
    <img alt='<?php echo $imageTitle; ?>' src='<?php echo $attachmentimage[0] ?> ' class='image-grid__image' /><span class='text-center'> <?php echo $imageTitle; ?></span>
    </a>
发布评论

评论列表(0)

  1. 暂无评论