We almost have complete support for pagination. All we need to do now is add a little bit of HTML and JavaScript to our project, and we'll have a nice experience.
1. Let's start by adding a line of CSS into our
master.css
file, so that our Load More button will look pretty.#load_more a {padding: 10px 0 10px 0; display: block; text-align: center; background: #e4e4e4; cursor: pointer;}
2. Now that we have the CSS in place, let's add the HTML for our Load More button at the bottom of the
post
list inside ourprofile.php
view.<h2> Posts (<span id="post_count"><?php echo $post_count; ?></span>) </h2> <div id="post_list"> <?php include('_posts.php'); ?> </div> <div id="load_more" class="row"> <div class="span8"> <a id="more_posts" href="#">Load More...</a> </div> </div>
3. Now, let's open
master.js
, and create a function inside the closing brackets of the...