<?php 
if (!is_user_logged_in()) {
    ?>
                    <a class="blog-nav-item" href="<?php 
    echo custom_get_page_permalink('login');
    ?>
">Login</a>
                    <a class="blog-nav-item" href="<?php 
    echo custom_get_page_permalink('register');
    ?>
">Register</a>
                  <?php 
} else {
    ?>
                    <a class="blog-nav-item" href="<?php 
    echo custom_get_page_permalink('profile');
    ?>
">My profile</a>     
                    <a class="blog-nav-item" href="<?php 
    echo wp_logout_url();
    ?>
">Logout</a> 
                  <?php 
}
?>
               </nav><!-- #site-navigation -->
            </div><!--#container-->
        </div><!-- #masthead -->     
    </div><!--#feedsite -->
    <div class="container">
        <div class="blog-header">
/*
 * How Many Posts to Display in List
 */
$posts_to_display = $num_posts < NUM_OF_POSTS ? $num_posts : NUM_OF_POSTS;
?>

        <h2>
            Expire soon

            <!-- Check If There Are More Posts to Display. If Yes, Show Link for More  -->
            <?php 
if (count($custom_results) > NUM_OF_POSTS) {
    ?>

            <a href="<?php 
    echo custom_get_page_permalink('expire');
    ?>
" class="pull-right"><small>See More</small></a>

            <?php 
}
?>

        </h2>

        <?php 
if ($custom_results) {
    global $post;
    for ($i = 0; $i < $posts_to_display; $i++) {
        $post = $custom_results[$i];
        setup_postdata($post);
            <div class="form-group">
                <div class="col-sm-5 col-sm-offset-7">
                    <input type="hidden" value="<?php 
echo $current_user_id;
?>
" name="updateProfile" />
                    <input type="submit" class="btn btn-default profile-update" id="inputPassword" value="Update profile">
                </div>              
            </div>            
        </form>                       
    </div><!-- #profile-info --> 
</div><!-- #profile-box -->
<div class="profile-box">
    <div class="btn-group btn-group-justified">
        <a href="<?php 
echo custom_get_page_permalink('add-post');
?>
" class="btn btn-default">Add post</a>    
        <a href="<?php 
echo custom_get_page_permalink('my-posts');
?>
" class="btn btn-default">My posts</a>
        <a href="<?php 
echo custom_get_page_permalink('my-comments');
?>
" class="btn btn-default">My comments</a>
    </div>
</div>

<?php 
get_footer();