Skip to content

Instantly share code, notes, and snippets.

Forked from kutoi94/page-account.php
Last active September 20, 2019 03:16
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
What would you like to do?
Page account create by bootstrap and MB Plugin
* Template Name: My Account
<link rel="stylesheet" href="" integrity="sha384-Gn5384xqQ1aoWXA+058RXPxPg6fy4IWvTNh0E263XmFcJlSAwiGgFAW/dAiS6JXm" crossorigin="anonymous">
<script src="" integrity="sha384-KJ3o2DKtIkvYIK3UENzmM7KCkRr/rE9/Qpg6aAZGJwFDMVNA/GpGFF93hXpG5KkN" crossorigin="anonymous"></script>
<script src="" integrity="sha384-ApNbgh9B+Y1QKtv3Rn7W3mgPxhU9K/ScQsAP7hUibX39j7fakFPskvXusvfa0b4Q" crossorigin="anonymous"></script>
<script src="" integrity="sha384-JZR6Spejh4U02d8jOt6vLEHfe/JQGiRRSQQxSfFWpi1MquVdAyjUar5+76PVCmYl" crossorigin="anonymous"></script>
if ( !is_user_logged_in() ) {
$current_user = wp_get_current_user();
<div class="wrap">
<div id="primary" class="content-area">
<main id="main" class="site-main" role="main">
<ul class="nav nav-tabs" id="myTab" role="tablist">
<li class="nav-item">
<a class="nav-link active" id="account-tab" data-toggle="tab" href="#account" role="tab" aria-controls="account" aria-selected="true">Account</a>
<li class="nav-item">
<a class="nav-link" id="Post-tab" data-toggle="tab" href="#Post" role="tab" aria-controls="Post" aria-selected="false">Your Post</a>
<div class="tab-content" id="TabContent">
<div class="tab-pane fade show active" id="account" role="tabpanel" aria-labelledby="account-tab">
while ( have_posts() ) :
endwhile; // End of the loop.
<div class="tab-pane fade" id="Post" role="tabpanel" aria-labelledby="Post-tab">
<p>Your list posts ! Once published, you can no longer edit a post.</p>
<table class="table table-hover table-striped">
<th>Date Created</th>
<tbody id="postTable">
$args_post_by_author = array(
'author' => $current_user->ID,
'orderby' => 'post_date',
'order' => 'ASC',
'posts_per_page' => -1,
'post_status' => array('publish', 'pending')
$posts_author = get_posts($args_post_by_author);
foreach ($posts_author as $post_author) { $count++; ?>
<td><?php echo $count; ?></td>
<td><?php echo wp_trim_words( $post_author->post_title, 10, '...'); ?></td>
<td><?php echo $post_author->post_date; ?></td>
<td><?php echo $post_author->post_status; ?></td>
<?php } ?>
<?php get_footer(); ?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment